do a merge instead of an insert

This commit is contained in:
Paul Trowbridge 2022-04-13 01:15:40 -04:00
parent d77b7910d5
commit 64af23cf04

View File

@ -35,7 +35,7 @@ BEGIN
--HAVING
-- string_agg(cname,', ') FILTER (WHERE fkey = func) <> ''
loop
INSERT INTO fc.sql SELECT f.func, f.ddl;
INSERT INTO fc.sql SELECT f.func, f.ddl ON CONFLICT ON CONSTRAINT sql_pkey DO UPDATE SET t = EXCLUDED.t;
EXECUTE format('%s',f.ddl);
EXECUTE format('%s',f.pop);
EXECUTE format('%s',f.fk);