comparison schema/gemma.sql @ 5656:796196f83678

Fix check_sr_in_bn_area trigger function to only use staging_done bn.
author Sascha Wilde <wilde@sha-bang.de>
date Wed, 04 Oct 2023 18:53:55 +0200
parents 8797274e2739
children 4bfcbb747768
comparison
equal deleted inserted replaced
5655:ace5358e1527 5656:796196f83678
246 AS $$ 246 AS $$
247 BEGIN 247 BEGIN
248 IF NOT st_intersects((SELECT area 248 IF NOT st_intersects((SELECT area
249 FROM waterway.bottlenecks 249 FROM waterway.bottlenecks
250 WHERE bottleneck_id = NEW.bottleneck_id 250 WHERE bottleneck_id = NEW.bottleneck_id
251 AND validity @> NEW.date_info::timestamptz), 251 AND validity @> NEW.date_info::timestamptz
252 AND staging_done),
252 NEW.area) 253 NEW.area)
253 THEN 254 THEN
254 RAISE EXCEPTION 255 RAISE EXCEPTION
255 'new row for relation "%" violates constraint trigger "%"', 256 'new row for relation "%" violates constraint trigger "%"',
256 TG_TABLE_NAME, TG_NAME 257 TG_TABLE_NAME, TG_NAME