gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: make CREATE TYPE usage idempoten


From: gnunet
Subject: [taler-exchange] branch master updated: make CREATE TYPE usage idempotent
Date: Fri, 02 Jun 2023 11:47:22 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 2ea3ae10 make CREATE TYPE usage idempotent
2ea3ae10 is described below

commit 2ea3ae1008020589b43a51663c45556a08547212
Author: Florian Dold <florian@dold.me>
AuthorDate: Fri Jun 2 11:46:48 2023 +0200

    make CREATE TYPE usage idempotent
    
    PostgresSQL doesn't have a CREATE TYPE OR REPLACE, so we have to work
    around this with exception handling.
---
 src/exchangedb/exchange_do_reserves_in_insert.sql | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/exchangedb/exchange_do_reserves_in_insert.sql 
b/src/exchangedb/exchange_do_reserves_in_insert.sql
index 20d1c55a..cf57d8e8 100644
--- a/src/exchangedb/exchange_do_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_reserves_in_insert.sql
@@ -970,15 +970,16 @@ END $$;
 
 
 
-
-
-
-
-
-CREATE TYPE exchange_do_array_reserve_insert_return_type
-  AS
-  (transaction_duplicate BOOLEAN
-  ,ruuid INT8);
+DO $$
+BEGIN
+  CREATE TYPE exchange_do_array_reserve_insert_return_type
+    AS
+    (transaction_duplicate BOOLEAN
+    ,ruuid INT8);
+EXCEPTION
+  WHEN duplicate_object THEN null;
+END
+$$;
 
 CREATE OR REPLACE FUNCTION exchange_do_array_reserves_insert(
   IN in_gc_date INT8,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]