diff schema/gemma.sql @ 4896:dd888bbb7e43 fairway-marks-import

Merge branch default into fairway-marks-import
author Tom Gottfried <tom@intevation.de>
date Fri, 24 Jan 2020 17:37:41 +0100
parents 9f799077a3e6 8a4c98b80fbd
children 638a61fb881b
line wrap: on
line diff
--- a/schema/gemma.sql	Tue Jan 14 18:24:51 2020 +0100
+++ b/schema/gemma.sql	Fri Jan 24 17:37:41 2020 +0100
@@ -27,6 +27,7 @@
 --
 
 -- Check if a given string can be used as a FROM item in an SQL statement
+-- All objects in stmt should be schema qualified if not in the public schema
 CREATE OR REPLACE FUNCTION is_valid_from_item(stmt text) RETURNS boolean
 AS $$
 BEGIN
@@ -38,6 +39,7 @@
         RETURN false;
 END
 $$
+    SET search_path TO 'public'
     LANGUAGE plpgsql
     STRICT;
 
@@ -229,7 +231,7 @@
 LANGUAGE plpgsql
 AS $$
 BEGIN
-    IF NOT st_intersects((SELECT area
+    IF NOT public.ST_Intersects((SELECT area
                           FROM waterway.bottlenecks
                           WHERE bottleneck_id = NEW.bottleneck_id
                             AND validity @> NEW.date_info::timestamptz),