make CREATE TYPE usage idempotent
PostgresSQL doesn't have a CREATE TYPE OR REPLACE, so we have to work around this with exception handling.
This commit is contained in:
parent
04885a289a
commit
2ea3ae1008
@ -970,15 +970,16 @@ END $$;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
CREATE TYPE exchange_do_array_reserve_insert_return_type
|
||||||
|
AS
|
||||||
|
(transaction_duplicate BOOLEAN
|
||||||
CREATE TYPE exchange_do_array_reserve_insert_return_type
|
,ruuid INT8);
|
||||||
AS
|
EXCEPTION
|
||||||
(transaction_duplicate BOOLEAN
|
WHEN duplicate_object THEN null;
|
||||||
,ruuid INT8);
|
END
|
||||||
|
$$;
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION exchange_do_array_reserves_insert(
|
CREATE OR REPLACE FUNCTION exchange_do_array_reserves_insert(
|
||||||
IN in_gc_date INT8,
|
IN in_gc_date INT8,
|
||||||
|
Loading…
Reference in New Issue
Block a user