[postgis-tickets] [SCM] PostGIS branch stable-2.5 updated. 2.5.5-26-g5ef8ff1e5

git at osgeo.org git at osgeo.org
Thu Feb 3 00:40:22 PST 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, stable-2.5 has been updated
       via  5ef8ff1e5d60a2ce4fe0ee4c37c6cc9700414443 (commit)
       via  539761b6f343cdd38355c6265e4ce801795a4b46 (commit)
      from  b68202a5fc956853328d8d06e6a02a02b06e253f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5ef8ff1e5d60a2ce4fe0ee4c37c6cc9700414443
Author: Regina Obe <lr at pcorp.us>
Date:   Thu Feb 3 03:40:15 2022 -0500

    Prep for PostGIS 2.5.6 release

diff --git a/NEWS b/NEWS
index 10d569ae6..b404ba2fd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,5 @@
-PostGIS 2.5.6dev
-YYYY/MM/DD
+PostGIS 2.5.6
+2022/02/03
 
  * Bug fixes *
 
@@ -11,6 +11,8 @@ YYYY/MM/DD
   - #4863, Update bboxes after affine/scale operations (Paul Ramsey)
   - #4326, Fix CircularPolygon area calculation (Paul Ramsey)
   - #4971, Cunit fixes for newer CUnit (Raúl Marín, Regina Obe)
+  - #5069, search_path vulnerabilty during install/upgrade
+           (Regina Obe)
 
 
 PostGIS 2.5.5
diff --git a/README.postgis b/README.postgis
index 888482a23..a4ff85f28 100644
--- a/README.postgis
+++ b/README.postgis
@@ -1,8 +1,8 @@
 PostGIS - Geographic Information Systems Extensions to PostgreSQL
 =================================================================
 
-:Version: 2.5.5
-:Date: 2020-08-15
+:Version: 2.5.6
+:Date: 2022-02-03
 :Website: http://postgis.net
 
 This distribution contains a module which implements GIS simple features, ties
diff --git a/Version.config b/Version.config
index b1e18525c..5955e973e 100644
--- a/Version.config
+++ b/Version.config
@@ -5,7 +5,7 @@
 
 POSTGIS_MAJOR_VERSION=2
 POSTGIS_MINOR_VERSION=5
-POSTGIS_MICRO_VERSION=6dev
+POSTGIS_MICRO_VERSION=6
 
 # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev)
 # when changing POSTGIS_MINOR_VERSION
diff --git a/doc/release_notes.xml b/doc/release_notes.xml
index 5db53b1fa..76303f38d 100644
--- a/doc/release_notes.xml
+++ b/doc/release_notes.xml
@@ -2,6 +2,23 @@
 <appendix id="release_notes">
   <title>Appendix</title>
     <subtitle>Release Notes</subtitle>
+    <sect1>
+      <title>PostGIS 2.5.6</title>
+      <para>Release Date: 2022/02/03</para>
+      <simplesect>
+        <title>Bug fixes</title>
+        <para>4968, Update autogen.sh to handle autoconf 2.71 issues</para>
+        <para>4871, TopoGeometry::geometry cast returns NULL for empty
+                  TopoGeometry objects (Sandro Santilli)</para>
+        <para>4757, Handle line collapse due to snap-to-existing node (Sandro Santilli)</para>
+        <para>4769, Fix segfault in st_addband (Raúl Marín)</para>
+        <para>4863, Update bboxes after affine/scale operations (Paul Ramsey)</para>
+        <para>4326, Fix CircularPolygon area calculation (Paul Ramsey)</para>
+        <para>4971, Cunit fixes for newer CUnit (Raúl Marín, Regina Obe)</para>
+        <para>5069, search_path vulnerabilty during install/upgrade
+                  (Regina Obe)</para>
+      </simplesect>
+    </sect1>
 
     <sect1>
       <title>Release 2.5.5</title>
diff --git a/extensions/upgradeable_versions.mk b/extensions/upgradeable_versions.mk
index 03236ceb7..497ce1ef9 100644
--- a/extensions/upgradeable_versions.mk
+++ b/extensions/upgradeable_versions.mk
@@ -48,6 +48,7 @@ UPGRADEABLE_VERSIONS = \
 	2.4.7 \
 	2.4.8 \
 	2.4.9 \
+	2.4.10 \
 	2.5.0 \
 	2.5.1 \
 	2.5.2 \

commit 539761b6f343cdd38355c6265e4ce801795a4b46
Author: Regina Obe <lr at pcorp.us>
Date:   Thu Feb 3 03:34:07 2022 -0500

    Search_path vulnerability during install. References #5069 for PostGIS 2.5.6

diff --git a/extensions/make_unpackaged.sql b/extensions/make_unpackaged.sql
index 37dfa0a7d..f8d1c4648 100644
--- a/extensions/make_unpackaged.sql
+++ b/extensions/make_unpackaged.sql
@@ -1,29 +1,29 @@
 -- for postgis
-SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || regexp_replace(
-    regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
+SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || pg_catalog.regexp_replace(
+    pg_catalog.regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
     E'(.*) for access method (.*)', E'\\1 using \\2') || ';' AS sqladd
 FROM pg_catalog.pg_depend AS d
-INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
+INNER JOIN pg_catalog.pg_extension AS e ON (d.refobjid = e.oid)
 WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
 AND deptype = 'e' AND e.extname = 'postgis'
 ORDER BY sqladd;
 
 -- for topology
-SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || regexp_replace(
-    regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
+SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || pg_catalog.regexp_replace(
+    pg_catalog.regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
     E'(.*) for access method (.*)', E'\\1 using \\2') || ';' AS sqladd
 FROM pg_catalog.pg_depend AS d
-INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
+INNER JOIN pg_catalog.pg_extension AS e ON (d.refobjid = e.oid)
 WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
 AND deptype = 'e' AND e.extname = 'postgis_topology'
 ORDER BY sqladd;
 
 -- for postgis tiger geocoder
-SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || regexp_replace(
-    regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
+SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || pg_catalog.regexp_replace(
+    pg_catalog.regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
     E'(.*) for access method (.*)', E'\\1 using \\2') || ';' AS sqladd
 FROM pg_catalog.pg_depend AS d
-INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
+INNER JOIN pg_catalog.pg_extension AS e ON (d.refobjid = e.oid)
 WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
 AND deptype = 'e' AND e.extname = 'postgis_tiger_geocoder'
 ORDER BY sqladd;
diff --git a/extensions/postgis_extension_helper.sql b/extensions/postgis_extension_helper.sql
index bc1e9f92d..ce961ba69 100644
--- a/extensions/postgis_extension_helper.sql
+++ b/extensions/postgis_extension_helper.sql
@@ -30,38 +30,38 @@ DECLARE
 	var_sql_list text := '';
 	var_pgsql_version integer := current_setting('server_version_num');
 BEGIN
-		var_class := CASE WHEN lower(param_type) = 'function' OR lower(param_type) = 'aggregate' THEN 'pg_proc' ELSE '' END;
-		var_is_aggregate := CASE WHEN lower(param_type) = 'aggregate' THEN true ELSE false END;
+		var_class := CASE WHEN pg_catalog.lower(param_type) = 'function' OR pg_catalog.lower(param_type) = 'aggregate' THEN 'pg_catalog.pg_proc' ELSE '' END;
+		var_is_aggregate := CASE WHEN pg_catalog.lower(param_type) = 'aggregate' THEN true ELSE false END;
 
 		IF var_pgsql_version < 110000 THEN
 			var_sql_list := $sql$SELECT 'ALTER EXTENSION ' || e.extname || ' DROP ' || $3 || ' ' || COALESCE(proc.proname || '(' || oidvectortypes(proc.proargtypes) || ')' ,typ.typname, cd.relname, op.oprname,
 					cs.typname || ' AS ' || ct.typname || ') ', opcname, opfname) || ';' AS remove_command
-			FROM pg_depend As d INNER JOIN pg_extension As e
-				ON d.refobjid = e.oid INNER JOIN pg_class As c ON
+			FROM pg_catalog.pg_depend As d INNER JOIN pg_catalog.pg_extension As e
+				ON d.refobjid = e.oid INNER JOIN pg_catalog.pg_class As c ON
 					c.oid = d.classid
-					LEFT JOIN pg_proc AS proc ON proc.oid = d.objid
-					LEFT JOIN pg_type AS typ ON typ.oid = d.objid
-					LEFT JOIN pg_class As cd ON cd.oid = d.objid
+					LEFT JOIN pg_catalog.pg_proc AS proc ON proc.oid = d.objid
+					LEFT JOIN pg_catalog.pg_type AS typ ON typ.oid = d.objid
+					LEFT JOIN pg_catalog.pg_class As cd ON cd.oid = d.objid
 					LEFT JOIN pg_operator As op ON op.oid = d.objid
-					LEFT JOIN pg_cast AS ca ON ca.oid = d.objid
-					LEFT JOIN pg_type AS cs ON ca.castsource = cs.oid
-					LEFT JOIN pg_type AS ct ON ca.casttarget = ct.oid
+					LEFT JOIN pg_catalog.pg_cast AS ca ON ca.oid = d.objid
+					LEFT JOIN pg_catalog.pg_type AS cs ON ca.castsource = cs.oid
+					LEFT JOIN pg_catalog.pg_type AS ct ON ca.casttarget = ct.oid
 					LEFT JOIN pg_opclass As oc ON oc.oid = d.objid
 					LEFT JOIN pg_opfamily As ofa ON ofa.oid = d.objid
 			WHERE d.deptype = 'e' and e.extname = $1 and c.relname = $2 AND COALESCE(proc.proisagg, false) = $4;$sql$;
 		ELSE -- for PostgreSQL 11 and above, they removed proc.proisagg among others and replaced with some func type thing
 			var_sql_list := $sql$SELECT 'ALTER EXTENSION ' || e.extname || ' DROP ' || $3 || ' ' || COALESCE(proc.proname || '(' || oidvectortypes(proc.proargtypes) || ')' ,typ.typname, cd.relname, op.oprname,
 					cs.typname || ' AS ' || ct.typname || ') ', opcname, opfname) || ';' AS remove_command
-			FROM pg_depend As d INNER JOIN pg_extension As e
-				ON d.refobjid = e.oid INNER JOIN pg_class As c ON
+			FROM pg_catalog.pg_depend As d INNER JOIN pg_catalog.pg_extension As e
+				ON d.refobjid = e.oid INNER JOIN pg_catalog.pg_class As c ON
 					c.oid = d.classid
-					LEFT JOIN pg_proc AS proc ON proc.oid = d.objid
-					LEFT JOIN pg_type AS typ ON typ.oid = d.objid
-					LEFT JOIN pg_class As cd ON cd.oid = d.objid
+					LEFT JOIN pg_catalog.pg_proc AS proc ON proc.oid = d.objid
+					LEFT JOIN pg_catalog.pg_type AS typ ON typ.oid = d.objid
+					LEFT JOIN pg_catalog.pg_class As cd ON cd.oid = d.objid
 					LEFT JOIN pg_operator As op ON op.oid = d.objid
-					LEFT JOIN pg_cast AS ca ON ca.oid = d.objid
-					LEFT JOIN pg_type AS cs ON ca.castsource = cs.oid
-					LEFT JOIN pg_type AS ct ON ca.casttarget = ct.oid
+					LEFT JOIN pg_catalog.pg_cast AS ca ON ca.oid = d.objid
+					LEFT JOIN pg_catalog.pg_type AS cs ON ca.castsource = cs.oid
+					LEFT JOIN pg_catalog.pg_type AS ct ON ca.casttarget = ct.oid
 					LEFT JOIN pg_opclass As oc ON oc.oid = d.objid
 					LEFT JOIN pg_opfamily As ofa ON ofa.oid = d.objid
 			WHERE d.deptype = 'e' and e.extname = $1 and c.relname = $2 AND (proc.prokind = 'a')  = $4;$sql$;
@@ -85,7 +85,7 @@ CREATE OR REPLACE FUNCTION postgis_extension_drop_if_exists(param_extension text
   RETURNS boolean AS
 $$
 DECLARE
-	var_sql_ext text := 'ALTER EXTENSION ' || quote_ident(param_extension) || ' ' || replace(param_statement, 'IF EXISTS', '');
+	var_sql_ext text := 'ALTER EXTENSION ' || pg_catalog.quote_ident(param_extension) || ' ' || pg_catalog.replace(param_statement, 'IF EXISTS', '');
 	var_result boolean := false;
 BEGIN
 	BEGIN
@@ -109,13 +109,13 @@ DECLARE
 	var_result text;
 	var_cur_search_path text;
 BEGIN
-	SELECT reset_val INTO var_cur_search_path FROM pg_settings WHERE name = 'search_path';
-	IF var_cur_search_path LIKE '%' || quote_ident(a_schema_name) || '%' THEN
+	SELECT reset_val INTO var_cur_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path';
+	IF var_cur_search_path LIKE '%' || pg_catalog.quote_ident(a_schema_name) || '%' THEN
 		var_result := a_schema_name || ' already in database search_path';
 	ELSE
 		var_cur_search_path := var_cur_search_path || ', '
-                        || quote_ident(a_schema_name);
-		EXECUTE 'ALTER DATABASE ' || quote_ident(current_database())
+                        || pg_catalog.quote_ident(a_schema_name);
+		EXECUTE 'ALTER DATABASE ' || pg_catalog.quote_ident(pg_catalog.current_database())
                               || ' SET search_path = ' || var_cur_search_path;
 		var_result := a_schema_name || ' has been added to end of database search_path ';
 	END IF;
diff --git a/extras/tiger_geocoder/utility/set_search_path.sql b/extras/tiger_geocoder/utility/set_search_path.sql
index c8e8595bb..19d2f9523 100644
--- a/extras/tiger_geocoder/utility/set_search_path.sql
+++ b/extras/tiger_geocoder/utility/set_search_path.sql
@@ -13,9 +13,9 @@ DECLARE
 	var_result text;
 	var_cur_search_path text;
 BEGIN
-	SELECT reset_val INTO var_cur_search_path FROM pg_settings WHERE name = 'search_path';
+	SELECT reset_val INTO var_cur_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path';
 
-	EXECUTE 'SET search_path = ' || quote_ident(a_schema_name) || ', ' || var_cur_search_path;
+	EXECUTE 'SET search_path = ' || pg_catalog.quote_ident(a_schema_name) || ', ' || var_cur_search_path;
 	var_result := a_schema_name || ' has been made primary for install ';
   RETURN var_result;
 END
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 315f31f50..109bfefe4 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -31,7 +31,7 @@ DECLARE
   rec RECORD;
 BEGIN
   FOR rec IN
-    SELECT n.nspname, p.proname FROM pg_proc p, pg_namespace n
+    SELECT n.nspname, p.proname FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n
     WHERE p.proname = 'postgis_version'
     AND p.pronamespace = n.oid
   LOOP
@@ -52,7 +52,7 @@ BEGIN
   -- a WARNING if in a previous version (only up to minor version checked)
   --
     curver_text := POSTGIS_LIB_VERSION;
-    IF split_part(curver_text,'.',1)::int > split_part(version,'.',1)::int OR
+    IF pg_catalog.split_part(curver_text,'.',1)::int > split_part(version,'.',1)::int OR
        ( split_part(curver_text,'.',1) = split_part(version,'.',1) AND
          split_part(curver_text,'.',2) != split_part(version,'.',2) )
     THEN
@@ -2090,7 +2090,7 @@ BEGIN
 
             IF use_typmod THEN
                 BEGIN
-                    EXECUTE 'ALTER TABLE ' || quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ALTER COLUMN ' || quote_ident(gcs.attname) ||
+                    EXECUTE 'ALTER TABLE ' || pg_catalog.quote_ident(gcs.nspname) || '.' || quote_ident(gcs.relname) || ' ALTER COLUMN ' || quote_ident(gcs.attname) ||
                         ' TYPE geometry(' || postgis_type_name(gtype, gndims, true) || ', ' || gsrid::text  || ') ';
                     inserted := inserted + 1;
                 EXCEPTION
@@ -2808,8 +2808,8 @@ CREATE OR REPLACE FUNCTION _postgis_scripts_pgsql_version() RETURNS text
 
 CREATE OR REPLACE FUNCTION _postgis_pgsql_version() RETURNS text
 AS $$
-	SELECT CASE WHEN split_part(s,'.',1)::integer > 9 THEN split_part(s,'.',1) || '0' ELSE split_part(s,'.', 1) || split_part(s,'.', 2) END AS v
-	FROM substring(version(), 'PostgreSQL ([0-9\.]+)') AS s;
+	SELECT CASE WHEN pg_catalog.split_part(s,'.',1)::integer > 9 THEN pg_catalog.split_part(s,'.',1) || '0' ELSE pg_catalog.split_part(s,'.', 1) || pg_catalog.split_part(s,'.', 2) END AS v
+	FROM pg_catalog.substring(pg_catalog.version(), 'PostgreSQL ([0-9\.]+)') AS s;
 $$ LANGUAGE 'sql' STABLE;
 
 -- Availability: 2.5.0
@@ -2821,7 +2821,7 @@ BEGIN
 	-- then do an upgrade to default version
 
 	FOR rec in SELECT  name, default_version, installed_version
-		FROM pg_available_extensions
+		FROM pg_catalog.pg_available_extensions
 		WHERE installed_version > '' AND name IN('postgis', 'postgis_sfcgal', 'postgis_tiger_geocoder', 'postgis_topology')
 		AND ( default_version <> installed_version  OR
 			( default_version = installed_version AND default_version ILIKE '%dev%' AND  installed_version ILIKE '%dev%'  )  ) LOOP
@@ -2829,12 +2829,12 @@ BEGIN
 		-- we need to upgrade to next so our installed is different from current
 		-- and then we can upgrade to default_version
 		IF rec.installed_version = rec.default_version THEN
-			sql = 'ALTER EXTENSION ' || rec.name || ' UPDATE TO ' || quote_ident(rec.default_version || 'next')   || ';';
+			sql = 'ALTER EXTENSION ' || rec.name || ' UPDATE TO ' || pg_catalog.quote_ident(rec.default_version || 'next')   || ';';
 			EXECUTE sql;
 			RAISE NOTICE '%', sql;
 		END IF;
 
-		sql = 'ALTER EXTENSION ' || rec.name || ' UPDATE TO ' || quote_ident(rec.default_version)   || ';';
+		sql = 'ALTER EXTENSION ' || rec.name || ' UPDATE TO ' || pg_catalog.quote_ident(rec.default_version)   || ';';
 		EXECUTE sql;
 		RAISE NOTICE '%', sql;
 	END LOOP;
@@ -2915,7 +2915,7 @@ BEGIN
 	END;
 
 	BEGIN
-		SELECT postgis_raster_scripts_installed() INTO rast_scr_ver;
+		SELECT @extschema at .postgis_raster_scripts_installed() INTO rast_scr_ver;
 	EXCEPTION
 		WHEN undefined_function THEN
 			rast_scr_ver := NULL;
diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in
index 0e17abcd7..bd10b1d9c 100644
--- a/raster/rt_pg/rtpostgis.sql.in
+++ b/raster/rt_pg/rtpostgis.sql.in
@@ -47,7 +47,7 @@ DECLARE
   rec RECORD;
 BEGIN
   FOR rec IN
-    SELECT n.nspname, p.proname FROM pg_proc p, pg_namespace n
+    SELECT n.nspname, p.proname FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n
     WHERE p.proname = 'postgis_raster_lib_version'
     AND p.pronamespace = n.oid
   LOOP
@@ -63,11 +63,11 @@ DECLARE
   nsp TEXT;
 BEGIN
   SELECT n.nspname
-	INTO nsp FROM pg_proc p, pg_namespace n
+	INTO nsp FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n
   WHERE p.proname = 'postgis_lib_version'
   AND p.pronamespace = n.oid;
 
-	IF nsp != current_schema() THEN
+	IF nsp != pg_catalog.current_schema() THEN
     RAISE EXCEPTION
 			'PostGIS Raster must be in the same schema as PostGIS (%)',
 			nsp;
diff --git a/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in b/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
index 0d6f3ba00..29bf9d2a7 100644
--- a/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
+++ b/raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in
@@ -589,7 +589,7 @@ BEGIN
 	FROM pg_proc f
 	JOIN pg_type t
 		ON f.prorettype = t.oid
-	WHERE lower(f.proname) = '_raster_constraint_nodata_values'
+	WHERE pg_catalog.lower(f.proname) = '_raster_constraint_nodata_values'
 		AND f.pronargs = 1
 		AND t.typname = '_float8'; -- array form
 
diff --git a/topology/sql/manage/ManageHelper.sql.in b/topology/sql/manage/ManageHelper.sql.in
index 31b70756b..fb23f4b85 100644
--- a/topology/sql/manage/ManageHelper.sql.in
+++ b/topology/sql/manage/ManageHelper.sql.in
@@ -26,12 +26,12 @@ DECLARE
 	var_cur_search_path text;
 BEGIN
 	SELECT reset_val INTO var_cur_search_path FROM pg_settings WHERE name = 'search_path';
-	IF var_cur_search_path LIKE '%' || quote_ident(a_schema_name) || '%' THEN
+	IF var_cur_search_path LIKE '%' || pg_catalog.quote_ident(a_schema_name) || '%' THEN
 		var_result := a_schema_name || ' already in database search_path';
 	ELSE
 		var_cur_search_path := var_cur_search_path || ', '
-                        || quote_ident(a_schema_name);
-		EXECUTE 'ALTER DATABASE ' || quote_ident(current_database())
+                        || pg_catalog.quote_ident(a_schema_name);
+		EXECUTE 'ALTER DATABASE ' || pg_catalog.quote_ident(current_database())
                               || ' SET search_path = ' || var_cur_search_path;
 		var_result := a_schema_name || ' has been added to end of database search_path ';
 	END IF;
diff --git a/utils/create_undef.pl b/utils/create_undef.pl
index f445a0543..4f8fcae02 100755
--- a/utils/create_undef.pl
+++ b/utils/create_undef.pl
@@ -308,14 +308,14 @@ DECLARE
 	var_search_path text;
 BEGIN
 	SELECT reset_val INTO var_search_path FROM pg_settings WHERE name = 'search_path';
-	IF var_search_path NOT LIKE '%' || quote_ident(a_schema_name) || '%' THEN
+	IF var_search_path NOT LIKE '%' || pg_catalog.quote_ident(a_schema_name) || '%' THEN
 		var_result := a_schema_name || ' not in database search_path';
 	ELSE
-    var_search_path := btrim( regexp_replace(
-        replace(var_search_path, a_schema_name, ''), ', *,', ','),
+    var_search_path := pg_catalog.btrim( pg_catalog.regexp_replace(
+        pg_catalog.replace(var_search_path, a_schema_name, ''), ', *,', ','),
         ', ');
     RAISE NOTICE 'New search_path: %', var_search_path;
-		EXECUTE 'ALTER DATABASE ' || quote_ident(current_database()) || ' SET search_path = ' || var_search_path;
+		EXECUTE 'ALTER DATABASE ' || pg_catalog.quote_ident(pg_catalog.current_database()) || ' SET search_path = ' || var_search_path;
 		var_result := a_schema_name || ' has been stripped off database search_path ';
 	END IF;
 
diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl
index a83af4282..7618d5e8f 100755
--- a/utils/postgis_proc_upgrade.pl
+++ b/utils/postgis_proc_upgrade.pl
@@ -495,8 +495,8 @@ BEGIN
 		SELECT into old_scripts MODULE_scripts_installed();
 	END;
 	SELECT into new_scripts ''NEWVERSION'';
-	SELECT into old_maj substring(old_scripts from 1 for 2);
-	SELECT into new_maj substring(new_scripts from 1 for 2);
+	SELECT into old_maj pg_catalog.substring(old_scripts, 1, 2);
+	SELECT into new_maj pg_catalog.substring(new_scripts, 1, 2);
 
 	IF old_maj != new_maj THEN
 		RAISE EXCEPTION ''Upgrade of MODULE from version % to version % requires a dump/reload. See PostGIS manual for instructions'', old_scripts, new_scripts;
@@ -517,11 +517,11 @@ CREATE TEMPORARY TABLE _postgis_upgrade_info AS WITH versions AS (
 ) SELECT
   upgraded as scripts_upgraded,
   installed as scripts_installed,
-  substring(upgraded from '([0-9]*)\.')::int * 100 +
-  substring(upgraded from '[0-9]*\.([0-9]*)\.')::int
+  pg_catalog.substring(upgraded,'([0-9]*)\.')::int * 100 +
+  pg_catalog.substring(upgraded, '[0-9]*\.([0-9]*)\.')::int
     as version_to_num,
-  substring(installed from '([0-9]*)\.')::int * 100 +
-  substring(installed from '[0-9]*\.([0-9]*)\.')::int
+  pg_catalog.substring(installed, '([0-9]*)\.')::int * 100 +
+  pg_catalog.substring(installed, '[0-9]*\.([0-9]*)\.')::int
     as version_from_num,
   installed ~ 'dev|alpha|beta'
     as version_from_isdev

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                              |  6 ++-
 README.postgis                                    |  4 +-
 Version.config                                    |  2 +-
 doc/release_notes.xml                             | 17 +++++++++
 extensions/make_unpackaged.sql                    | 18 ++++-----
 extensions/postgis_extension_helper.sql           | 46 +++++++++++------------
 extensions/upgradeable_versions.mk                |  1 +
 extras/tiger_geocoder/utility/set_search_path.sql |  4 +-
 postgis/postgis.sql.in                            | 18 ++++-----
 raster/rt_pg/rtpostgis.sql.in                     |  6 +--
 raster/rt_pg/rtpostgis_upgrade_cleanup.sql.in     |  2 +-
 topology/sql/manage/ManageHelper.sql.in           |  6 +--
 utils/create_undef.pl                             |  8 ++--
 utils/postgis_proc_upgrade.pl                     | 12 +++---
 14 files changed, 85 insertions(+), 65 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list