[postgis-tickets] r16344 - Improve check for probin consistency

Sandro Santilli strk at kbt.io
Sat Jan 20 12:32:44 PST 2018


Author: strk
Date: 2018-01-20 00:32:44 -0800 (Sat, 20 Jan 2018)
New Revision: 16344

Modified:
   trunk/regress/regress.sql
   trunk/regress/sfcgal/regress.sql
Log:
Improve check for probin consistency

See #4000

Modified: trunk/regress/regress.sql
===================================================================
--- trunk/regress/regress.sql	2018-01-19 22:43:55 UTC (rev 16343)
+++ trunk/regress/regress.sql	2018-01-20 08:32:44 UTC (rev 16344)
@@ -270,13 +270,15 @@
 -- Drop test table
 DROP table test;
 
--- Make sure all postgis-referencing probin are using the module
--- version expected by postgis_lib_version()
+-- Make sure all postgis-referencing probin are using the
+-- same module version and path as expected by postgis_lib_version()
 --
-SELECT distinct 'unexpected probin', proname || ':' || probin
+SELECT DISTINCT 'unexpected probin', proname || ':' || probin
 FROM pg_proc
 WHERE probin like '%postgis%'
-	AND probin NOT LIKE '%' ||
-		substring(postgis_lib_version() from '([0-9]*\.[0-9]*)')
-		|| '%'
+   AND regexp_replace(probin, '(rt)?postgis(_[^-]*)?', '') !=
+(
+SELECT regexp_replace(probin, '(rt)?postgis(_[^-]*)?', '')
+	FROM pg_proc WHERE proname = 'postgis_lib_version'
+)
 ORDER BY 2;

Modified: trunk/regress/sfcgal/regress.sql
===================================================================
--- trunk/regress/sfcgal/regress.sql	2018-01-19 22:43:55 UTC (rev 16343)
+++ trunk/regress/sfcgal/regress.sql	2018-01-20 08:32:44 UTC (rev 16344)
@@ -275,13 +275,15 @@
 -- Drop test table
 DROP table test;
 
--- Make sure all postgis-referencing probin are using the module
--- version expected by postgis_lib_version()
+-- Make sure all postgis-referencing probin are using the
+-- same module version and path as expected by postgis_lib_version()
 --
-SELECT distinct 'unexpected probin', proname || ':' || probin
+SELECT DISTINCT 'unexpected probin', proname || ':' || probin
 FROM pg_proc
 WHERE probin like '%postgis%'
-	AND probin NOT LIKE '%' ||
-		substring(postgis_lib_version() from '([0-9]*\.[0-9]*)')
-		|| '%'
+   AND regexp_replace(probin, '(rt)?postgis(_[^-]*)?', '') !=
+(
+SELECT regexp_replace(probin, '(rt)?postgis(_[^-]*)?', '')
+	FROM pg_proc WHERE proname = 'postgis_lib_version'
+)
 ORDER BY 2;



More information about the postgis-tickets mailing list