commit 9218606c55d80fcdd673fbacdb5b73a32793b6b3
parent 5686dd370a535cd2fc4d03ed3fee2c590343cc6f
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 3 Jun 2024 21:17:47 +0200
drop functions after use
Diffstat:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/exchangedb/exchange_do_create_tables.sql b/src/exchangedb/exchange_do_create_tables.sql
@@ -100,7 +100,10 @@ BEGIN
,rec.name
);
END IF;
-
+ EXECUTE FORMAT(
+ 'DROP FUNCTION exchange.create_table_%s'::text
+ ,rec.name
+ );
-- "alter" actions apply to master and partitions
WHEN 'alter'
THEN
@@ -109,6 +112,10 @@ BEGIN
'SELECT exchange.alter_table_%s ()'::text
,rec.name
);
+ EXECUTE FORMAT(
+ 'DROP FUNCTION exchange.alter_table_%s'::text
+ ,rec.name
+ );
-- Constrain action apply to master OR each partition
WHEN 'constrain'
THEN
@@ -141,6 +148,10 @@ BEGIN
END LOOP;
END IF;
END IF;
+ EXECUTE FORMAT(
+ 'DROP FUNCTION exchange.constrain_table_%s'::text
+ ,rec.name
+ );
-- Foreign actions only apply if partitioning is off
WHEN 'foreign'
THEN
@@ -153,12 +164,20 @@ BEGIN
,NULL
);
END IF;
+ EXECUTE FORMAT(
+ 'DROP FUNCTION exchange.foreign_table_%s'::text
+ ,rec.name
+ );
WHEN 'master'
THEN
EXECUTE FORMAT(
'SELECT exchange.master_table_%s ()'::text
,rec.name
);
+ EXECUTE FORMAT(
+ 'DROP FUNCTION exchange.master_table_%s'::text
+ ,rec.name
+ );
ELSE
ASSERT FALSE, 'unsupported action type: ' || rec.action;
END CASE; -- END CASE (rec.action)