Mercurial > gemma
annotate schema/updates/1008/01.import-delete.sql @ 4761:a5ff1bbac4dc
Removed SR simplification code.
It never worked as expected and is currently unused.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sat, 19 Oct 2019 18:13:56 +0200 |
parents | 4f2f34f5d14d |
children |
rev | line source |
---|---|
4033
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 DROP FUNCTION import.del_import(); |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 CREATE OR REPLACE FUNCTION import.del_import(imp_id int) RETURNS void AS |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 $$ |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 DECLARE |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 tmp RECORD; |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 BEGIN |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 FOR tmp IN |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 SELECT * FROM import.track_imports WHERE import_id = imp_id AND NOT deletion |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 LOOP |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 EXECUTE format('DELETE FROM %s WHERE id = $1', tmp.relation) USING tmp.key; |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 END LOOP; |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 END; |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 $$ |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 LANGUAGE plpgsql; |
4f2f34f5d14d
Schema: delete only import entry that are for deletion.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 |