[SCM] PostGIS branch stable-3.4 updated. 3.4.5-10-g05b736d08

git at osgeo.org git at osgeo.org
Tue Mar 17 16:08:59 PDT 2026


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-3.4 has been updated
       via  05b736d089ae4bc3bdc148eb4fe58e5764a18cd7 (commit)
      from  3da3457c1ecd4cfc7cd079eb29dfdcac2d5198a8 (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 05b736d089ae4bc3bdc148eb4fe58e5764a18cd7
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Mar 17 16:08:19 2026 -0700

    Function qualification improvements to avoid name squatting during upgrades
    References #6055

diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in
index 21d072b27..4814afe36 100644
--- a/extensions/postgis/Makefile.in
+++ b/extensions/postgis/Makefile.in
@@ -134,8 +134,10 @@ sql/postgis_for_extension.sql: ../../postgis/postgis.sql.in ../../postgis_revisi
 	rm -f $@.tmp
 
 sql/postgis_upgrade.sql: sql/postgis_upgrade_for_extension.sql | sql
-	$(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@
-
+	cat $< | \
+	$(PERL) -lpe "s/BEGIN\;//g" | \
+	$(PERL) -lpe "s/COMMIT\;//g" | \
+	$(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@
 
 sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql
 	printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
diff --git a/extensions/postgis_extension_helper.sql.in b/extensions/postgis_extension_helper.sql.in
index b0f73015b..0d642fee8 100644
--- a/extensions/postgis_extension_helper.sql.in
+++ b/extensions/postgis_extension_helper.sql.in
@@ -19,7 +19,9 @@ CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_sta
   RETURNS boolean AS
 $$
 DECLARE
-	var_sql_ext text := 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) pg_catalog.quote_ident(param_extension) OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) pg_catalog.replace(param_statement, 'IF EXISTS', '');
+	var_sql_ext text := pg_catalog.format('ALTER EXTENSION %s %s',
+		pg_catalog.quote_ident(param_extension),
+		pg_catalog.replace(param_statement, 'IF EXISTS', ''));
 	var_result boolean := false;
 BEGIN
 	BEGIN
@@ -27,13 +29,13 @@ BEGIN
 		var_result := true;
 	EXCEPTION
 		WHEN OTHERS THEN
-			--this is to allow ignoring if the object does not exist in extension
+			-- This is to allow ignoring if the object does not exist in extension
 			var_result := false;
 	END;
 	RETURN var_result;
 END;
 $$
-LANGUAGE plpgsql VOLATILE;
+LANGUAGE 'plpgsql' VOLATILE;
 
 CREATE FUNCTION postgis_extension_AddToSearchPath(a_schema_name text)
 #include "libpgcommon/sql/AddToSearchPath.sql.inc"
diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql
index 756dc80f8..c582d3511 100644
--- a/extensions/postgis_extension_helper_uninstall.sql
+++ b/extensions/postgis_extension_helper_uninstall.sql
@@ -13,6 +13,6 @@
 --
 -- This drops extension helper functions
 -- and should be called at the end of the extension upgrade file
-DROP FUNCTION postgis_extension_drop_if_exists(text, text);
+DROP FUNCTION IF EXISTS postgis_extension_drop_if_exists(text, text);
 DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(varchar);
 DROP FUNCTION IF EXISTS postgis_extension_AddToSearchPath(text);
diff --git a/extensions/postgis_raster/Makefile.in b/extensions/postgis_raster/Makefile.in
index 25ade7d21..f69f053a7 100644
--- a/extensions/postgis_raster/Makefile.in
+++ b/extensions/postgis_raster/Makefile.in
@@ -99,7 +99,10 @@ sql/rtpostgis_for_extension.sql: ../../raster/rt_pg/rtpostgis.sql.in ../../postg
 	rm -f $@.tmp
 
 sql/rtpostgis_upgrade.sql: sql/rtpostgis_upgrade_for_extension.sql | sql
-	$(PERL) -pe "s/BEGIN\;//g ; s/COMMIT\;//g; s/^(DROP .*)\;/SELECT postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" $< > $@
+	cat $< | \
+	$(PERL) -lpe "s/BEGIN\;//g" | \
+	$(PERL) -lpe "s/COMMIT\;//g" | \
+	$(PERL) -lpe "s/^(DROP .*)\;/SELECT \@extschema\@.postgis_extension_drop_if_exists('$(EXTENSION)', '\1');\n\1\;/" > $@
 
 #this keeps the @extschema at . in place since extension machinery will replace during install
 sql/rtpostgis_upgrade_for_extension.sql: ../../postgis/common_before_upgrade.sql ../../raster/rt_pg/rtpostgis_upgrade_cleanup.sql sql/rtpostgis_upgrade_for_extension.sql.in ../../raster/rt_pg/rtpostgis_drop.sql ../../postgis/common_after_upgrade.sql | sql
diff --git a/postgis/Makefile.in b/postgis/Makefile.in
index 0e972da7e..4f581b626 100644
--- a/postgis/Makefile.in
+++ b/postgis/Makefile.in
@@ -242,14 +242,15 @@ endif
 #
 %.sql: %.sql.in
 	$(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< > $@.tmp
-	grep -v '^#' $@.tmp | $(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@
+	grep -v '^#' $@.tmp | \
+		$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" | \
+		$(PERL) -lpe "s'@extschema@\.''g" > $@
 	rm -f $@.tmp
 
 #this is redundant but trying to fold in with extension just hangs
 postgis_upgrade.sql.in: postgis.sql ../utils/create_upgrade.pl
 	$(PERL) @top_srcdir@/utils/create_upgrade.pl $< > $@
 
-
 postgis_upgrade.sql: common_before_upgrade.sql postgis_before_upgrade.sql postgis_upgrade.sql.in postgis_after_upgrade.sql common_after_upgrade.sql
 	echo "BEGIN;" > $@
 	cat $^ >> $@
diff --git a/postgis/common_before_upgrade.sql b/postgis/common_before_upgrade.sql
index 6492a5778..9b522e4c5 100644
--- a/postgis/common_before_upgrade.sql
+++ b/postgis/common_before_upgrade.sql
@@ -42,7 +42,7 @@ DECLARE
 	postgis_namespace OID;
 	matching_function pg_catalog.pg_proc;
 	detail TEXT;
-	deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version;
+	deprecated_suffix TEXT := pg_catalog.concat('_deprecated_by_postgis_', deprecated_in_version);
 BEGIN
 
 	-- Fetch install namespace for PostGIS
@@ -56,15 +56,15 @@ BEGIN
 	SELECT *
 	FROM pg_catalog.pg_proc p
 	WHERE pronamespace = postgis_namespace
-	AND pg_catalog.LOWER(p.proname) = pg_catalog.LOWER(function_name)
+	AND p.proname ILIKE function_name
 	AND pg_catalog.pg_function_is_visible(p.oid)
-	AND pg_catalog.LOWER(pg_catalog.pg_get_function_identity_arguments(p.oid)) = pg_catalog.LOWER(function_arguments)
+	AND pg_catalog.pg_get_function_identity_arguments(p.oid) ILIKE function_arguments
 	INTO matching_function;
 
 	IF matching_function.oid IS NOT NULL THEN
-		sql := format('ALTER FUNCTION %s RENAME TO %I',
+		sql := pg_catalog.format('ALTER FUNCTION %s RENAME TO %I',
 			matching_function.oid::regprocedure,
-			matching_function.proname || deprecated_suffix
+			pg_catalog.concat(matching_function.proname, deprecated_suffix)
 		);
 		RAISE DEBUG 'SQL query: %', sql;
 		BEGIN
@@ -79,7 +79,7 @@ BEGIN
 	END IF;
 
 END;
-$$ LANGUAGE plpgsql;
+$$ LANGUAGE 'plpgsql';
 
 CREATE OR REPLACE FUNCTION _postgis_drop_function_by_signature(
   function_signature text,
@@ -90,7 +90,7 @@ DECLARE
 	detail TEXT;
 	newname TEXT;
 	proc RECORD;
-	deprecated_suffix TEXT := '_deprecated_by_postgis_' || deprecated_in_version;
+	deprecated_suffix TEXT := pg_catalog.concat('_deprecated_by_postgis_', deprecated_in_version);
 BEGIN
 
 	-- Check if the deprecated function exists
@@ -116,7 +116,7 @@ BEGIN
 	sql := pg_catalog.format(
 		'ALTER FUNCTION %s RENAME TO %I',
 		proc.oid::regprocedure,
-		proc.proname || deprecated_suffix
+		pg_catalog.concat(proc.proname, deprecated_suffix)
 	);
 	EXECUTE sql;
 
diff --git a/utils/create_uninstall.pl b/utils/create_uninstall.pl
index 1f351e362..4e3985b65 100755
--- a/utils/create_uninstall.pl
+++ b/utils/create_uninstall.pl
@@ -287,10 +287,10 @@ DECLARE
 BEGIN
 	FOR rec IN
 		SELECT n.nspname, c.relname, a.attname, t.typname
-		FROM pg_attribute a
-		JOIN pg_class c ON a.attrelid = c.oid
-		JOIN pg_namespace n ON c.relnamespace = n.oid
-		JOIN pg_type t ON a.atttypid = t.oid
+		FROM pg_catalog.pg_attribute a
+		JOIN pg_catalog.pg_class c ON a.attrelid = c.oid
+		JOIN pg_catalog.pg_namespace n ON c.relnamespace = n.oid
+		JOIN pg_catalog.pg_type t ON a.atttypid = t.oid
 		WHERE t.typname = '$type'
 		  AND NOT (
 				-- we exclude complexes defined as types
@@ -398,16 +398,16 @@ DECLARE
 	var_result text;
 	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
+	SELECT reset_val INTO var_search_path FROM pg_catalog.pg_settings WHERE name = 'search_path';
+	IF NOT var_search_path ~ 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;
-		var_result := a_schema_name || ' has been stripped off database search_path ';
+		EXECUTE pg_catalog.Format('ALTER DATABASE %s SET search_path = %s', pg_catalog.quote_ident(current_database()), var_search_path);
+		var_result := pg_catalog.Concat(a_schema_name, ' has been stripped off database search_path ');
 	END IF;
 
   RETURN var_result;
diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl
index 3920ffaa4..a34183ee9 100755
--- a/utils/create_upgrade.pl
+++ b/utils/create_upgrade.pl
@@ -117,10 +117,18 @@ while(<INPUT>)
 
         #last;
     }
+    elsif (/CREATE SCHEMA topology/)
+    {
+        $module = 'postgis_topology';
+    }
     elsif (/TYPE raster/)
     {
         $module = 'postgis_raster';
     }
+    elsif (/FUNCTION postgis_sfcgal_noop/)
+    {
+        $module = 'postgis_sfcgal';
+    }
     elsif (m@('\$libdir/[^']*')@)
     {
         $soname = $1;

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

Summary of changes:
 extensions/postgis/Makefile.in                    |  6 ++++--
 extensions/postgis_extension_helper.sql.in        |  8 +++++---
 extensions/postgis_extension_helper_uninstall.sql |  2 +-
 extensions/postgis_raster/Makefile.in             |  5 ++++-
 postgis/Makefile.in                               |  5 +++--
 postgis/common_before_upgrade.sql                 | 16 ++++++++--------
 utils/create_uninstall.pl                         | 20 ++++++++++----------
 utils/create_upgrade.pl                           |  8 ++++++++
 8 files changed, 43 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list