diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-07-29 23:01:06 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-07-29 23:01:15 +0200 |
commit | e47e5c0cfba7746263775e8bbd4064b640f69020 (patch) | |
tree | 4d853f7e1d065a198b32dd14d38df179cf288e15 /src/exchangedb/pg_ensure_coin_known.c | |
parent | ecf6b2750bb6ed9157aece72602dd042a50e36f3 (diff) | |
download | exchange-e47e5c0cfba7746263775e8bbd4064b640f69020.tar.xz |
migration to new amount style for exchangedb
Diffstat (limited to 'src/exchangedb/pg_ensure_coin_known.c')
-rw-r--r-- | src/exchangedb/pg_ensure_coin_known.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/exchangedb/pg_ensure_coin_known.c b/src/exchangedb/pg_ensure_coin_known.c index 721123fd3..346135756 100644 --- a/src/exchangedb/pg_ensure_coin_known.c +++ b/src/exchangedb/pg_ensure_coin_known.c @@ -60,9 +60,8 @@ TEH_PG_ensure_coin_known (void *cls, &is_age_hash_null), GNUNET_PQ_result_spec_end }; - /* Used in #postgres_insert_known_coin() to store the denomination public - key and signature for a coin known to the exchange. + /* See also: https://stackoverflow.com/questions/34708509/how-to-use-returning-with-on-conflict-in-postgresql/37543015#37543015 */ @@ -70,13 +69,11 @@ TEH_PG_ensure_coin_known (void *cls, "insert_known_coin", "WITH dd" " (denominations_serial" - " ,coin_val" - " ,coin_frac" + " ,coin" " ) AS (" " SELECT " " denominations_serial" - " ,coin_val" - " ,coin_frac" + " ,coin" " FROM denominations" " WHERE denom_pub_hash=$2" " ), input_rows" @@ -88,15 +85,13 @@ TEH_PG_ensure_coin_known (void *cls, " ,denominations_serial" " ,age_commitment_hash" " ,denom_sig" - " ,remaining_val" - " ,remaining_frac" + " ,remaining" " ) SELECT " " $1" " ,denominations_serial" " ,$3" " ,$4" - " ,coin_val" - " ,coin_frac" + " ,coin" " FROM dd" " ON CONFLICT DO NOTHING" /* CONFLICT on (coin_pub) */ " RETURNING " |