diff options
| author | alex <alex@pdp7.net> | 2023-10-13 16:11:25 +0200 |
|---|---|---|
| committer | alex <alex@pdp7.net> | 2023-10-13 16:11:25 +0200 |
| commit | 250201b433c0a99f6cabcb2596bfe43f1a5a3968 (patch) | |
| tree | 8dc5de16ed4315b3ab4fcc001b7dbd74d475c4b3 /blog/content/2011/12/upserts.gmi | |
| parent | 1a80ac63854ba4ea28f81194ad15314771e979d5 (diff) | |
Moving to prod!
Diffstat (limited to 'blog/content/2011/12/upserts.gmi')
| -rw-r--r-- | blog/content/2011/12/upserts.gmi | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/blog/content/2011/12/upserts.gmi b/blog/content/2011/12/upserts.gmi new file mode 100644 index 00000000..a163de5b --- /dev/null +++ b/blog/content/2011/12/upserts.gmi @@ -0,0 +1,11 @@ +# Upserts... +2011-12-17 + +Trabajando en un pequeño experimento[1], se me ha ocurrido un insert idempotente: + +insert into foo (bar) (select 'bar_value' as bar where not exists (select 1 from foo where bar = 'bar_value')); + +(la sintaxis es de PostgreSQL, pero supongo que es adaptable a otras bases de datos). Igual intento adaptarlo a hacer upserts. + + +=> https://github.com/alexpdp7/tvguide 1: https://github.com/alexpdp7/tvguide
\ No newline at end of file |
