summaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-01-08 19:45:00 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2022-01-08 19:45:00 +0100
commitd6bf20028dc55174cd413a37ed70d8c73f7519e6 (patch)
treefc40ed6864177dd0d8420cab47cc27b1769e042c /src/exchangedb
parentcc7d7707ab2bd43bc9e95c0eeec9ce95cdc0c523 (diff)
downloadexchange-d6bf20028dc55174cd413a37ed70d8c73f7519e6.tar.gz
exchange-d6bf20028dc55174cd413a37ed70d8c73f7519e6.tar.bz2
exchange-d6bf20028dc55174cd413a37ed70d8c73f7519e6.zip
Fixed prepared statement for extensions
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 268279f3a..fc90f37a6 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2746,13 +2746,9 @@ prepare_statements (struct PostgresClosure *pg)
/* Used in #postgres_set_extension_config */
GNUNET_PQ_make_prepare (
"set_extension_config",
- "WITH upsert AS "
- " (UPDATE extensions "
- " SET config=$2 "
- " config_sig=$3 "
- " WHERE name=$1 RETURNING *) "
- "INSERT INTO extensions (config, config_sig) VALUES ($2, $3) "
- "WHERE NOT EXISTS (SELECT * FROM upsert);",
+ "INSERT INTO extensions (name, config, config_sig) VALUES ($1, $2, $3) "
+ "ON CONFLICT (name) "
+ "DO UPDATE SET (config, config_sig) = ($2, $3)",
3),
/* Used in #postgres_get_extension_config */
GNUNET_PQ_make_prepare (