Mercurial > gemma
view schema/updates/1008/01.import-delete.sql @ 4590:acd802a76b93 iso-areas
Merged default into iso-areas branch.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 09 Oct 2019 10:22:47 +0200 |
parents | 4f2f34f5d14d |
children |
line wrap: on
line source
DROP FUNCTION import.del_import(); CREATE OR REPLACE FUNCTION import.del_import(imp_id int) RETURNS void AS $$ DECLARE tmp RECORD; BEGIN FOR tmp IN SELECT * FROM import.track_imports WHERE import_id = imp_id AND NOT deletion LOOP EXECUTE format('DELETE FROM %s WHERE id = $1', tmp.relation) USING tmp.key; END LOOP; END; $$ LANGUAGE plpgsql;