[SCM] PostGIS branch stable-3.3 updated. 3.3.9-8-gd55c69743

git at osgeo.org git at osgeo.org
Tue Mar 17 16:08:51 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.3 has been updated
       via  d55c697432e5023d99b9fa30e2b8e67ecfd23a4e (commit)
      from  ad3d8e090666cf4822e6735c4288e75111aabcef (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 d55c697432e5023d99b9fa30e2b8e67ecfd23a4e
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Mar 17 16:08:40 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 d79b0dfc3..bc5607010 100644
--- a/extensions/postgis/Makefile.in
+++ b/extensions/postgis/Makefile.in
@@ -141,8 +141,10 @@ sql/postgis_for_extension.sql: ../../postgis/postgis.sql.in ../../postgis_revisi
 		| $(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' > $@
 
 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 18ff93746..18e87edb4 100644
--- a/extensions/postgis_raster/Makefile.in
+++ b/extensions/postgis_raster/Makefile.in
@@ -97,7 +97,10 @@ sql/rtpostgis_for_extension.sql: ../../raster/rt_pg/rtpostgis.sql.in ../../postg
 	$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" > $@
 
 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: ../../raster/rt_pg/rtpostgis_upgrade_cleanup.sql sql/rtpostgis_upgrade_for_extension.sql.in ../../raster/rt_pg/rtpostgis_drop.sql | sql
diff --git a/postgis/Makefile.in b/postgis/Makefile.in
index 0bcb61b69..b4d77ef99 100644
--- a/postgis/Makefile.in
+++ b/postgis/Makefile.in
@@ -237,8 +237,10 @@ endif
 # and adding the version number
 # replace @extschema at . with nothing, this is only used as placeholder for extension install
 %.sql: %.sql.in
-	$(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< | grep -v '^#' | \
-	$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g;s'@extschema@\.''g" > $@
+	$(SQLPP) -I at top_srcdir@/libpgcommon -I at builddir@ $< | \
+	grep -v '^#' | \
+	$(PERL) -lpe "s'MODULE_PATHNAME'\$(MODULEPATH)'g" | \
+	$(PERL) -lpe "s'@extschema@\.''g" > $@
 
 #this is redundant but trying to fold in with extension just hangs
 postgis_upgrade.sql.in: postgis.sql ../utils/create_upgrade.pl
diff --git a/utils/create_undef.pl b/utils/create_undef.pl
index 4036801dc..1e72bdb50 100755
--- a/utils/create_undef.pl
+++ b/utils/create_undef.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,19 @@ 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
-		var_result := a_schema_name || ' not in database search_path';
+	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 := pg_catalog.concat(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 d983068d0..f6c702484 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                               |  6 ++++--
 utils/create_undef.pl                             | 25 +++++++++++++----------
 utils/create_upgrade.pl                           |  8 ++++++++
 7 files changed, 40 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list