Mercurial > gemma
view schema/updates/1008/01.import-delete.sql @ 4605:7650d2431f86 geoserver_sql_views
Separate schema and table name
Since a GeoServer data source is bound to a specific database schema,
names have to be given without schema qualification. Since we cannot
use regclass for names of SQL views, the name is now a varchar. This
way it's more straightforward to store schema and name separately.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 05 Sep 2019 11:33:01 +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;