Mercurial > gemma
annotate schema/updates/1103/01.fix_constraint_error_codes.sql @ 5115:bb5459faadb7 queued-stage-done
Dont leave old jobs behind if retrying remove jobs.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 25 Mar 2020 18:02:46 +0100 |
parents | ec8438712447 |
children |
rev | line source |
---|---|
4132
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
1 -- This is Free Software under GNU Affero General Public License v >= 3.0 |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
2 -- without warranty, see README.md and license for details. |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
3 |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
4 -- SPDX-License-Identifier: AGPL-3.0-or-later |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
5 -- License-Filename: LICENSES/AGPL-3.0.txt |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
6 |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
7 -- Copyright (C) 2019 by via donau |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
8 -- – Österreichische Wasserstraßen-Gesellschaft mbH |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
9 -- Software engineering by Intevation GmbH |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
10 |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
11 -- Author(s): |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
12 -- * Sascha Wilde <sascha.wilde@intevation.de> |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
13 |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
14 -- |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
15 -- CONSTRAINT FUNCTIONS |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
16 -- |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
17 -- The only change in the following functions is the error code |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
18 -- returend in case of failure: it should be |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
19 -- 23503: foreign_key_violation |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
20 -- as what we are emulating is kind of an foreign key... |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
21 |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
22 CREATE OR REPLACE FUNCTION check_valid_gauge() RETURNS trigger AS |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
23 $$ |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
24 DECLARE |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
25 -- FIXME: I'm using text for the isrs code and cast it on demand. |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
26 -- If someone is able to get it to work with isrs or isrs_base as |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
27 -- type, feel free to show me how its done... ;-) [sw] |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
28 referenced_gauge text; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
29 new_validity tstzrange; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
30 BEGIN |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
31 EXECUTE format('SELECT $1.%I', TG_ARGV[0]) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
32 INTO referenced_gauge |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
33 USING NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
34 EXECUTE format('SELECT $1.%I', TG_ARGV[1]) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
35 INTO new_validity |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
36 USING NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
37 IF EXISTS ( SELECT * FROM waterway.gauges |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
38 WHERE location = referenced_gauge::isrs |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
39 AND validity && new_validity ) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
40 THEN |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
41 RETURN NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
42 ELSE |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
43 RAISE EXCEPTION |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
44 'new row for relation "%" violates constraint trigger "%"', |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
45 TG_TABLE_NAME, TG_NAME |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
46 USING |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
47 DETAIL = format('No matching gauge %s found.', |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
48 isrs_AsText(referenced_gauge::isrs)), |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
49 ERRCODE = 23503, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
50 SCHEMA = TG_TABLE_SCHEMA, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
51 TABLE = TG_TABLE_NAME, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
52 COLUMN = TG_ARGV[0], |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
53 CONSTRAINT = TG_NAME; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
54 END IF; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
55 END; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
56 $$ |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
57 LANGUAGE plpgsql; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
58 |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
59 CREATE OR REPLACE FUNCTION check_valid_gauge_ts() RETURNS trigger AS |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
60 $$ |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
61 DECLARE |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
62 -- FIXME: I'm using text for the isrs code and cast it on demand. |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
63 -- If someone is able to get it to work with isrs or isrs_base as |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
64 -- type, feel free to show me how its done... ;-) [sw] |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
65 referenced_gauge text; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
66 new_tstz timestamptz; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
67 BEGIN |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
68 EXECUTE format('SELECT $1.%I', TG_ARGV[0]) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
69 INTO referenced_gauge |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
70 USING NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
71 EXECUTE format('SELECT $1.%I', TG_ARGV[1]) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
72 INTO new_tstz |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
73 USING NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
74 IF EXISTS ( SELECT * FROM waterway.gauges |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
75 WHERE location = referenced_gauge::isrs |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
76 AND validity @> new_tstz ) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
77 THEN |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
78 RETURN NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
79 ELSE |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
80 RAISE EXCEPTION |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
81 'new row for relation "%" violates constraint trigger "%"', |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
82 TG_TABLE_NAME, TG_NAME |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
83 USING |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
84 DETAIL = format('No matching gauge %s for %s found.', |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
85 (isrs_AsText(referenced_gauge::isrs)), new_tstz), |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
86 ERRCODE = 23503, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
87 SCHEMA = TG_TABLE_SCHEMA, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
88 TABLE = TG_TABLE_NAME, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
89 COLUMN = TG_ARGV[0], |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
90 CONSTRAINT = TG_NAME; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
91 END IF; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
92 END; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
93 $$ |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
94 LANGUAGE plpgsql; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
95 |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
96 CREATE OR REPLACE FUNCTION check_valid_bottleneck_ts() RETURNS trigger AS |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
97 $$ |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
98 DECLARE |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
99 referenced_bottleneck_id text; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
100 new_tstz timestamptz; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
101 BEGIN |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
102 EXECUTE format('SELECT $1.%I', TG_ARGV[0]) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
103 INTO referenced_bottleneck_id |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
104 USING NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
105 EXECUTE format('SELECT $1.%I', TG_ARGV[1]) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
106 INTO new_tstz |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
107 USING NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
108 IF EXISTS ( SELECT * FROM waterway.bottlenecks |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
109 WHERE bottleneck_id = referenced_bottleneck_id |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
110 AND validity @> new_tstz ) |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
111 THEN |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
112 RETURN NEW; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
113 ELSE |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
114 RAISE EXCEPTION |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
115 'new row for relation "%" violates constraint trigger "%"', |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
116 TG_TABLE_NAME, TG_NAME |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
117 USING |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
118 DETAIL = format('No matching bottleneck %s for %s found.', |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
119 referenced_bottleneck_id, new_tstz), |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
120 ERRCODE = 23503, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
121 SCHEMA = TG_TABLE_SCHEMA, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
122 TABLE = TG_TABLE_NAME, |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
123 COLUMN = TG_ARGV[0], |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
124 CONSTRAINT = TG_NAME; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
125 END IF; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
126 END; |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
127 $$ |
ec8438712447
Enable better error handling for referenced gauges/bottlenecks constraints.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
128 LANGUAGE plpgsql; |