diff options
| author | Christian Grothoff <christian@grothoff.org> | 2023-02-05 21:59:41 +0100 |
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2023-02-05 21:59:41 +0100 |
| commit | 6d3efbe900ed47f2ce501d795bf4a0dd186d1b91 (patch) | |
| tree | 5dd8f2ff2d26e3050f1df1da2cf80abe93690324 /src/exchangedb/exchange_do_batch_reserves_in_insert.sql | |
| parent | f079cff4ae81ee2a6a522326cfecabaed49efd5b (diff) | |
-debugging batch reserves_in notification logic: success: pg_notify does not work, identifier vs. string
Diffstat (limited to 'src/exchangedb/exchange_do_batch_reserves_in_insert.sql')
| -rw-r--r-- | src/exchangedb/exchange_do_batch_reserves_in_insert.sql | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql index 73947b4b..4eec2e00 100644 --- a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql @@ -22,7 +22,7 @@ CREATE OR REPLACE FUNCTION exchange_do_batch_reserves_in_insert( IN in_credit_val INT8, IN in_credit_frac INT4, IN in_exchange_account_name VARCHAR, - IN in_exectution_date INT8, + IN in_execution_date INT8, IN in_wire_source_h_payto BYTEA, ---h_payto IN in_payto_uri VARCHAR, IN in_reserve_expiration INT8, @@ -39,10 +39,11 @@ DECLARE DECLARE curs_trans refcursor; BEGIN -ruuid= 0; -out_reserve_found = TRUE; -transaction_duplicate= TRUE; - --SIMPLE INSERT ON CONFLICT DO NOTHING + ruuid = 0; + out_reserve_found = TRUE; + transaction_duplicate = TRUE; + +--SIMPLE INSERT ON CONFLICT DO NOTHING INSERT INTO wire_targets (wire_target_h_payto ,payto_uri) @@ -97,7 +98,7 @@ transaction_duplicate= TRUE; ,in_credit_frac ,in_exchange_account_name ,in_wire_source_h_payto - ,in_expiration_date) + ,in_execution_date) ON CONFLICT DO NOTHING RETURNING reserve_pub) SELECT * FROM reserve_transaction; @@ -108,7 +109,9 @@ transaction_duplicate= TRUE; THEN -- HAPPY PATH THERE IS NO DUPLICATE TRANS transaction_duplicate = FALSE; - PERFORM pg_notify(in_notify, NULL); + EXECUTE FORMAT ( + 'NOTIFY %s' + ,in_notify); END IF; END IF; CLOSE curs_trans; |
