[SCM] PostGIS branch stable-3.5 updated. 3.5.7-134-g4486e53f9

git at osgeo.org git at osgeo.org
Sat Aug 15 11:48:38 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.5 has been updated
       via  4486e53f99c77e34dd4496d0a1242208486cccf8 (commit)
       via  ad26a6d745d3eaa66d95f50fa93507713f41f116 (commit)
      from  e7811d2463cafd4b70cd65b8296f8638a64af3c2 (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 4486e53f99c77e34dd4496d0a1242208486cccf8
Merge: e7811d246 ad26a6d74
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date:   Sat Aug 15 11:48:37 2026 -0700

    Merge pull request '[3.5] Fix postgis_tiger_geocoder CREATE EXTENSION CASCADE failing on PostgreSQL < 16' (!743) from Komzpa/postgis:fix/tiger-extschema-3.5-20260815 into stable-3.5
    
    The SQL-side `@extschema:postgis@`/`@extschema:fuzzystrmatch@` schema-qualification hardening backported into this branch was missing the Makefile-side mechanism that makes those tokens safe on PostgreSQL versions older than 16, which stable-3.6 has shipped since commit bc0854651 (August 2024). Rather than wrapping the install scripts in a runtime shim, this ports that existing mechanism: `extensions/postgis_tiger_geocoder/Makefile.in` now strips `@extschema:<name>@.` prefixes from the generated install and minor-upgrade SQL at build time when `POSTGIS_PGSQL_VERSION < 160`, and leaves them untouched on PostgreSQL 16+ where core substitutes them natively. No SQL source changes.
    
    References https://gitea.osgeo.org/postgis/postgis/pulls/710
    
    Validated: the generated `postgis_tiger_geocoder--<version>.sql` carries zero `@extschema:` tokens on a PostgreSQL < 16 build and `CREATE EXTENSION postgis_tiger_geocoder CASCADE` succeeds; on PostgreSQL 16+ the tokens are retained and substituted by core, and CASCADE also succeeds. `test-normalize_address` and `test-upgrade` pass. No file under `extras/tiger_geocoder` is modified.
    
    Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/743


commit ad26a6d745d3eaa66d95f50fa93507713f41f116
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Sat Aug 15 22:44:34 2026 +0400

    tiger_geocoder: strip @extschema qualification for PostgreSQL < 16 at build time
    
    The tiger_geocoder schema-qualification hardening backported into this
    branch writes @extschema:postgis@ and @extschema:fuzzystrmatch@ tokens
    into extras/tiger_geocoder SQL sources. PostgreSQL only substitutes
    this @extschema:<name>@ form starting with version 16; on every older
    server the token reaches the parser unsubstituted and CREATE EXTENSION
    postgis_tiger_geocoder CASCADE fails with a syntax error at "@". The
    backport carried the SQL-side qualification but not the Makefile-side
    mechanism that makes it safe on PostgreSQL < 16, which stable-3.6 has
    shipped since commit bc0854651 (August 2024).
    
    This ports that mechanism: extensions/postgis_tiger_geocoder/Makefile.in
    gates an EXTSCHEMA_SUPPORTED flag on POSTGIS_PGSQL_VERSION < 160 and, when
    unsupported, strips the @extschema:<name>@. prefixes from the generated
    install and minor-upgrade SQL at build time, falling back to plain
    unqualified calls resolved through tiger's search_path exactly as before
    the hardening. On PostgreSQL 16 and newer the tokens are left in place and
    substituted by core, keeping the hardening's protection against search_path
    prefix hijacking intact where it can actually run. No extras/tiger_geocoder
    SQL source changes; only the build-time generation step changes.
    
    Reference https://gitea.osgeo.org/postgis/postgis/pulls/710

diff --git a/NEWS b/NEWS
index db4e72880..e68fa1907 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,11 @@ PostGIS 3.5.8
     Sarath Kumar, IITM Pravartak Security Team; fixed by Darafei Praliaskouski)
   - Stop the extension upgrade script running ANALYZE inside its transaction,
     where it can deadlock with autovacuum (Darafei Praliaskouski)
+  - GT-710, [tiger_geocoder] Strip @extschema:<name>@ schema qualification
+    from the generated install SQL at build time on PostgreSQL < 16, fixing
+    CREATE EXTENSION postgis_tiger_geocoder CASCADE syntax errors on those
+    versions while keeping the qualification on PostgreSQL 16 and newer
+    (Darafei Praliaskouski)
   - OSSFuzz 5877056525893632, reject truncated encoded polyline input
     (Darafei Praliaskouski)
   - GT-677, Fix temporary geometry leaks in ST_DWithin (Darafei Praliaskouski)
diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in
index 5ce60da42..269ff3e8a 100644
--- a/extensions/postgis_tiger_geocoder/Makefile.in
+++ b/extensions/postgis_tiger_geocoder/Makefile.in
@@ -1,5 +1,6 @@
 include @srcdir@/../upgradeable_versions.mk
 
+POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
 EXTENSION    = postgis_tiger_geocoder
 EXTVERSION    = @POSTGIS_LIB_VERSION@
 MINORVERSION  = 2011. at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@
@@ -30,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}
@@ -50,8 +57,15 @@ expected:
 sql:
 	mkdir -p $@
 
+ifeq ($(EXTSCHEMA_SUPPORTED),yes)
 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
 	cat $^ > $@
@@ -192,9 +206,15 @@ 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' \
 	 	 $< > $@
+else
+sql/tiger_geocoder_upgrade_minor.sql:  sql/tiger_geocoder_minor.sql.in | sql
+	sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' -e 's/@extschema:[^@]*@\.//g' \
+	 	 $< > $@
+endif
 
 #only extension files
 EXTRA_CLEAN += $(wildcard expected/*--*.out)

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

Summary of changes:
 NEWS                                          |  5 +++++
 extensions/postgis_tiger_geocoder/Makefile.in | 20 ++++++++++++++++++++
 2 files changed, 25 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list