view schema/updates/1008/01.import-delete.sql @ 5279:a17c2a0b8e44

client: use current time in the review layer request * avoid using value from time slider in the request for review layer
author Fadi Abbud <fadi.abbud@intevation.de>
date Thu, 11 Jun 2020 15:50:11 +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;