aboutsummaryrefslogtreecommitdiff
path: root/content/2011/12/upserts.gmi
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2021-03-13 11:43:27 +0100
committeralex <alex@pdp7.net>2021-03-13 11:43:27 +0100
commit71d53390b95dba0ffe9ca90a5ea346f8314e2afa (patch)
tree198683640c9fd7cd187dac30d06fc7feed655178 /content/2011/12/upserts.gmi
parent389ca805686f8ec7238dd6b994825380974dc001 (diff)
Initial (draft) build
Diffstat (limited to 'content/2011/12/upserts.gmi')
-rw-r--r--content/2011/12/upserts.gmi11
1 files changed, 11 insertions, 0 deletions
diff --git a/content/2011/12/upserts.gmi b/content/2011/12/upserts.gmi
new file mode 100644
index 00000000..a163de5b
--- /dev/null
+++ b/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