diff schema/isrs_tests.sql @ 4431:8fcabb6f971e

Fix operator support functions Operators used in an operator class should not be based on SQL functions, which might be inlined, thus preventing index usage based on the operator. Schema qualify functions called inside functions to make the outer function work independendly from search_path setting. This makes it possible to use the operators using the 'OPERATOR(<schema>.<opname>)' syntax. Most importantly, it fixes the usage of isrs_diff() during autovacuum.
author Tom Gottfried <tom@intevation.de>
date Wed, 18 Sep 2019 17:26:28 +0200
parents 4c585b5d4fe8
children
line wrap: on
line diff
--- a/schema/isrs_tests.sql	Wed Sep 18 16:36:06 2019 +0200
+++ b/schema/isrs_tests.sql	Wed Sep 18 17:26:28 2019 +0200
@@ -81,6 +81,15 @@
         isrs_fromText('ATXXX000000000006570')),
     'isrsrange: Overlap depends on hectometre');
 
+SELECT lives_ok($$
+    SET search_path TO '';
+    SELECT public.isrs_diff(
+        CAST('(AT,XXX,00000,00000,0)' as public.isrs),
+        CAST('(AT,XXX,00000,00000,1)' as public.isrs));
+    RESET search_path;
+    $$,
+    'Support function runs with empty search path (as during autovacuum)');
+
 --
 -- Geometry processing
 --