[SCM] PostGIS branch master updated. 3.6.0rc2-331-g3a860ff70

git at osgeo.org git at osgeo.org
Mon Feb 9 15:28:19 PST 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, master has been updated
       via  3a860ff70a1a29f02ffbbac913e53eb1e5098bc7 (commit)
      from  5fac7d16ab444240d465a36d717b4f0b95c068dd (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 3a860ff70a1a29f02ffbbac913e53eb1e5098bc7
Author: Regina Obe <lr at pcorp.us>
Date:   Mon Feb 9 18:26:56 2026 -0500

    Remove postgis_extension_remove_objects
    References #5853 for PostGIS 3.7.0
    
    Fix postgis_tiger_geocoder upgrade for PostgreSQL < 16
    References #6032 for PostGIS 3.7.0dev

diff --git a/extensions/postgis_extension_helper.sql.in b/extensions/postgis_extension_helper.sql.in
index d9c648683..3341f9ef1 100644
--- a/extensions/postgis_extension_helper.sql.in
+++ b/extensions/postgis_extension_helper.sql.in
@@ -14,54 +14,6 @@
 -- This is a suite of SQL helper functions for use during a PostGIS extension install/upgrade
 -- The functions get uninstalled after the extension install/upgrade process
 ---------------------------
--- postgis_extension_remove_objects: This function removes objects of a particular class from an extension
--- this is needed because there is no ALTER EXTENSION DROP FUNCTION/AGGREGATE command
--- and we can't CREATE OR REPLACE functions whose signatures have changed and we can drop them if they are part of an extension
--- So we use this to remove it from extension first before we drop
-CREATE FUNCTION postgis_extension_remove_objects(param_extension text, param_type text)
-  RETURNS boolean AS
-$$
-DECLARE
-	var_sql text := '';
-	var_r record;
-	var_result boolean := false;
-	var_class text := '';
-	var_is_aggregate boolean := false;
-        var_sql_list text := '';
-BEGIN
-		var_class := CASE WHEN pg_catalog.lower(param_type) OPERATOR(pg_catalog.=)'function' OR pg_catalog.lower(param_type) OPERATOR(pg_catalog.=) 'aggregate' THEN 'pg_catalog.pg_proc' ELSE '' END;
-		var_is_aggregate := CASE WHEN pg_catalog.lower(param_type) OPERATOR(pg_catalog.=) 'aggregate' THEN true ELSE false END;
-
-                var_sql_list := $sql$SELECT 'ALTER EXTENSION ' OPERATOR(pg_catalog.||) e.extname OPERATOR(pg_catalog.||) ' DROP ' OPERATOR(pg_catalog.||) $3 OPERATOR(pg_catalog.||) ' ' OPERATOR(pg_catalog.||) COALESCE(proc.proname OPERATOR(pg_catalog.||) '(' OPERATOR(pg_catalog.||) oidvectortypes(proc.proargtypes) OPERATOR(pg_catalog.||) ')' ,typ.typname, cd.relname, op.oprname,
-                                        cs.typname OPERATOR(pg_catalog.||) ' AS ' OPERATOR(pg_catalog.||) ct.typname OPERATOR(pg_catalog.||) ') ', opcname, opfname) OPERATOR(pg_catalog.||) ';' AS remove_command
-                        FROM pg_catalog.pg_depend As d INNER JOIN pg_catalog.pg_extension As e
-                                ON d.refobjid OPERATOR(pg_catalog.=) e.oid INNER JOIN pg_catalog.pg_class As c ON
-                                        c.oid OPERATOR(pg_catalog.=) d.classid
-                                        LEFT JOIN pg_catalog.pg_proc AS proc ON proc.oid OPERATOR(pg_catalog.=) d.objid
-                                        LEFT JOIN pg_catalog.pg_type AS typ ON typ.oid OPERATOR(pg_catalog.=) d.objid
-                                        LEFT JOIN pg_catalog.pg_class As cd ON cd.oid OPERATOR(pg_catalog.=) d.objid
-                                        LEFT JOIN pg_operator As op ON op.oid OPERATOR(pg_catalog.=) d.objid
-                                        LEFT JOIN pg_catalog.pg_cast AS ca ON ca.oid OPERATOR(pg_catalog.=) d.objid
-                                        LEFT JOIN pg_catalog.pg_type AS cs ON ca.castsource OPERATOR(pg_catalog.=) cs.oid
-                                        LEFT JOIN pg_catalog.pg_type AS ct ON ca.casttarget OPERATOR(pg_catalog.=) ct.oid
-                                        LEFT JOIN pg_opclass As oc ON oc.oid OPERATOR(pg_catalog.=) d.objid
-                                        LEFT JOIN pg_opfamily As ofa ON ofa.oid OPERATOR(pg_catalog.=) d.objid
-                        WHERE d.deptype OPERATOR(pg_catalog.=) 'e' and e.extname OPERATOR(pg_catalog.=) $1 and c.relname OPERATOR(pg_catalog.=) $2 AND (proc.prokind OPERATOR(pg_catalog.=) 'a') OPERATOR(pg_catalog.=) $4;$sql$;
-
-		FOR var_r IN EXECUTE var_sql_list  USING param_extension, var_class, param_type, var_is_aggregate
-		LOOP
-			var_sql := var_sql OPERATOR(pg_catalog.||) var_r.remove_command OPERATOR(pg_catalog.||) ';';
-		END LOOP;
-		IF var_sql > '' THEN
-			EXECUTE var_sql;
-			var_result := true;
-		END IF;
-
-		RETURN var_result;
-END;
-$$
-LANGUAGE plpgsql VOLATILE;
-
 CREATE FUNCTION postgis_extension_drop_if_exists(param_extension text, param_statement text)
   RETURNS boolean AS
 $$
diff --git a/extensions/postgis_extension_helper_uninstall.sql b/extensions/postgis_extension_helper_uninstall.sql
index 2fb1d1756..756dc80f8 100644
--- a/extensions/postgis_extension_helper_uninstall.sql
+++ b/extensions/postgis_extension_helper_uninstall.sql
@@ -13,7 +13,6 @@
 --
 -- This drops extension helper functions
 -- and should be called at the end of the extension upgrade file
-DROP FUNCTION postgis_extension_remove_objects(text, text);
 DROP FUNCTION 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_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in
index c486ec0cc..e0faf1caf 100644
--- a/extensions/postgis_tiger_geocoder/Makefile.in
+++ b/extensions/postgis_tiger_geocoder/Makefile.in
@@ -31,6 +31,12 @@ DATA_built = \
 
 REGRESS = test-normalize_address test-upgrade
 REGRESS_OPTS = --load-extension=fuzzystrmatch --load-extension=postgis --load-extension=$(EXTENSION)
+EXTSCHEMA_SUPPORTED = yes
+
+## PostgreSQL < 16 doesn't understand new @extschema:extname@ syntax, so strip it
+ifeq ($(shell expr "$(POSTGIS_PGSQL_VERSION)" "<" 160),1)
+EXTSCHEMA_SUPPORTED = no
+endif
 
 SQL_BITS     = $(wildcard sql_bits/*.sql)
 EXTRA_CLEAN = sql expected ${SQL_BITS}
@@ -51,14 +57,14 @@ expected:
 sql:
 	mkdir -p $@
 
-
-## PostgreSQL < 16 doesn't understand new @extschema:extname@ syntax, so strip it
-ifeq ($(shell expr "$(POSTGIS_PGSQL_VERSION)" "<" 160),1)
+ifeq ($(EXTSCHEMA_SUPPORTED),yes)
 sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
-	$(PERL) -lpe "s/\@extschema:[a-z]+\@\./ /g" < $< > $@
-else
- sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
 	cp $< $@
+else
+# PG < 16 doesn't support new @extschema:<extension_name>@
+# so we need to strip those out
+sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
+	$(PERL) -lpe "s/\@extschema:[^@]+\@\./ /g" < $< > $@
 endif
 
 expected/test-normalize_address.out: sql_bits/test_tuples_only_unaligned.sql.in ../../extras/tiger_geocoder/regress/normalize_address_regress | expected
@@ -75,13 +81,13 @@ sql/test-upgrade.sql: | sql
 	echo 'ALTER EXTENSION ${EXTENSION} UPDATE TO "ANY"; ALTER EXTENSION ${EXTENSION} UPDATE TO "$(EXTVERSION)"' > $@
 
 ## no_relocate clause is only available in PostgreSQL 16 and above, so strip it for lower
-ifeq ($(shell expr "$(POSTGIS_PGSQL_VERSION)" "<" 160),1)
-%.control: %.control.in Makefile
-	$(PERL) -lpe 's/^no_relocate.*//g; s/\@EXTVERSION\@/$(EXTVERSION)/g'  < "$<" > "$@"
-else
+ifeq ($(EXTSCHEMA_SUPPORTED),yes)
 %.control: %.control.in Makefile
 	$(PERL) -lpe "s'@EXTVERSION@'$(EXTVERSION)'g" \
 		  < "$<" > "$@"
+else
+%.control: %.control.in Makefile
+	$(PERL) -lpe 's/^no_relocate.*//g; s/\@EXTVERSION\@/$(EXTVERSION)/g'  < "$<" > "$@"
 endif
 
 expected/test-upgrade.out: sql/test-upgrade.sql | expected
@@ -98,7 +104,7 @@ sql/$(EXTENSION).sql: sql/$(EXTENSION)_pre.sql ../../utils/create_or_replace_to_
 		| $(PERL) @top_srcdir@/utils/create_or_replace_to_create.pl sql/$(EXTENSION)_pre.sql \
 		> $@
 
-sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: ../postgis_extension_helper.sql sql_bits/remove_from_extension.sql.in sql/tiger_geocoder_upgrade_minor.sql sql_bits/mark_editable_objects.sql.in | sql
+sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: ../postgis_extension_helper.sql sql/tiger_geocoder_upgrade_minor.sql sql_bits/mark_editable_objects.sql.in | sql
 	cat $^ > $@
 	echo "SELECT postgis_extension_drop_if_exists('${EXTENSION}', 'DROP SCHEMA tiger_data');" >> $@
 	cat @srcdir@/../postgis_extension_helper_uninstall.sql  >> $@
@@ -205,9 +211,14 @@ sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/tiger_geocoder--unpack
 #aggregates are special
 #they can be dropped but we need to remove
 #them from the extension first
+ifeq ($(EXTSCHEMA_SUPPORTED),yes)
 sql/tiger_geocoder_upgrade_minor.sql:  sql/tiger_geocoder_minor.sql.in | sql
-	sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
-	 	 $< > $@
+	$(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g' $< > $@
+else
+sql/tiger_geocoder_upgrade_minor.sql:  sql/tiger_geocoder_minor.sql.in | sql
+	$(PERL) -pe 's/BEGIN\;//g ; s/COMMIT\;//g ; s/\@extschema:[^@]+\@\.//g' $< > $@
+endif
+
 
 #only extension files
 EXTRA_CLEAN += $(wildcard expected/*--*.out)
diff --git a/extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sql.in b/extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sql.in
deleted file mode 100644
index c0fc12a3e..000000000
--- a/extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sql.in
+++ /dev/null
@@ -1,19 +0,0 @@
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---
-----
--- PostGIS - Spatial Types for PostgreSQL
--- http://postgis.net
---
--- Copyright (C) 2011 Regina Obe <lr at pcorp.us>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
---
--- Author: Regina Obe <lr at pcorp.us>
---
--- This drops extension helper functions
--- and should be called at the end of the extension upgrade file
--- removes all postgis_topology functions from postgis_topology extension since they will be read
--- during upgrade
-SELECT postgis_extension_remove_objects('postgis_tiger_geocoder', 'FUNCTION');
-SELECT postgis_extension_remove_objects('postgis_tiger_geocoder', 'AGGREGATE');
diff --git a/extensions/postgis_topology/Makefile.in b/extensions/postgis_topology/Makefile.in
index ef3f6034c..0bc04fc56 100644
--- a/extensions/postgis_topology/Makefile.in
+++ b/extensions/postgis_topology/Makefile.in
@@ -42,7 +42,6 @@ DATA_built = \
 EXTENSION_UPGRADE_SCRIPTS = \
 	extlock.sql \
 	../postgis_extension_helper.sql \
-	sql_bits/remove_from_extension.sql.in \
 	sql/topology_upgrade.sql \
 	sql_bits/mark_editable_objects.sql.in \
 	../postgis_extension_helper_uninstall.sql
diff --git a/extensions/postgis_topology/sql_bits/remove_from_extension.sql.in b/extensions/postgis_topology/sql_bits/remove_from_extension.sql.in
deleted file mode 100644
index cc4cca819..000000000
--- a/extensions/postgis_topology/sql_bits/remove_from_extension.sql.in
+++ /dev/null
@@ -1,19 +0,0 @@
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---
-----
--- PostGIS - Spatial Types for PostgreSQL
--- http://postgis.net
---
--- Copyright (C) 2011 Regina Obe <lr at pcorp.us>
---
--- This is free software; you can redistribute and/or modify it under
--- the terms of the GNU General Public Licence. See the COPYING file.
---
--- Author: Regina Obe <lr at pcorp.us>
---
--- This drops extension helper functions
--- and should be called at the end of the extension upgrade file
--- removes all postgis_topology functions from postgis_topology extension since they will be read
--- during upgrade
-SELECT postgis_extension_remove_objects('postgis_topology', 'FUNCTION');
-SELECT postgis_extension_remove_objects('postgis_topology', 'AGGREGATE');

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

Summary of changes:
 extensions/postgis_extension_helper.sql.in         | 48 ----------------------
 extensions/postgis_extension_helper_uninstall.sql  |  1 -
 extensions/postgis_tiger_geocoder/Makefile.in      | 37 +++++++++++------
 .../sql_bits/remove_from_extension.sql.in          | 19 ---------
 extensions/postgis_topology/Makefile.in            |  1 -
 .../sql_bits/remove_from_extension.sql.in          | 19 ---------
 6 files changed, 24 insertions(+), 101 deletions(-)
 delete mode 100644 extensions/postgis_tiger_geocoder/sql_bits/remove_from_extension.sql.in
 delete mode 100644 extensions/postgis_topology/sql_bits/remove_from_extension.sql.in


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list