[SCM] PostGIS branch stable-3.3 updated. 3.3.10-132-g47098a123

git at osgeo.org git at osgeo.org
Sat Aug 15 11:48:31 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  47098a123eb435ea5f249df0808e6731756677d2 (commit)
       via  942e2fe572ee18cbfb393661a12439acc67c26ec (commit)
      from  3ce1a36539ec8db913f226f56288593433c11516 (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 47098a123eb435ea5f249df0808e6731756677d2
Merge: 3ce1a3653 942e2fe57
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date:   Sat Aug 15 11:48:30 2026 -0700

    Merge pull request '[3.3] Fix postgis_tiger_geocoder CREATE EXTENSION CASCADE failing on PostgreSQL < 16' (!745) from Komzpa/postgis:fix/tiger-extschema-3.3-20260815 into stable-3.3
    
    This branch's `postgis_tiger_geocoder` install previously wrapped every `extras/tiger_geocoder` SQL file in a `DO $shim$` block to work around `@extschema:postgis@`/`@extschema:fuzzystrmatch@` tokens that PostgreSQL only substitutes starting with version 16. That approach has been replaced with a much smaller build-time fix: `extensions/postgis_tiger_geocoder/Makefile.in` now strips `@extschema:<name>@` qualification from the generated install script only when building against PostgreSQL below 16 (via a new `EXTSCHEMA_SUPPORTED` flag gated on `POSTGIS_PGSQL_VERSION`), leaving the qualification — and its protection against search-path hijacking — fully intact on PostgreSQL 16 and newer. No SQL source is modified.
    
    References https://gitea.osgeo.org/postgis/postgis/pulls/712
    
    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/745


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

    tiger_geocoder: strip @extschema qualification for PostgreSQL < 16 at build time
    
    The tiger_geocoder schema-qualification hardening backported into this
    branch's extras/tiger_geocoder tree writes calls such as
    @extschema:fuzzystrmatch at .soundex(...) and @extschema:postgis at .geometry.
    PostgreSQL only substitutes the colon form of the @extschema@ macro
    starting with PostgreSQL 16; on every older server version this branch
    supports, the token was left literal in the generated install script and
    CREATE EXTENSION postgis_tiger_geocoder CASCADE failed with a syntax error
    at the first such token.
    
    The SQL-side hardening was backported without stable-3.6's Makefile-side
    stripping mechanism that makes those tokens safe on PostgreSQL versions
    below 16. This change ports that mechanism: an EXTSCHEMA_SUPPORTED flag
    gated on POSTGIS_PGSQL_VERSION < 160 controls whether the generated
    install script and minor upgrade script keep the @extschema:<name>@
    qualification (PostgreSQL 16 and newer, where core substitutes the
    tokens against the real installed schemas) or have it stripped at
    generation time (PostgreSQL below 16, falling back to the tiger schema's
    own search_path setup). No SQL source under extras/tiger_geocoder is
    touched; the qualification and its search-path-hijacking protection on
    PostgreSQL 16+ are unchanged. stable-3.6 has shipped this exact
    mechanism since commit bc0854651 (August 2024).
    
    References https://gitea.osgeo.org/postgis/postgis/pulls/712

diff --git a/NEWS b/NEWS
index 39153f94c..37c95baaa 100644
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,11 @@ PostGIS 3.3.11
  - [tiger_geocoder] Qualify PostGIS and fuzzystrmatch calls, generated table
    DDL, PAGC tables, loader scripts, topology loader, and dynamic SQL
    against unsafe search paths (Regina Obe, Paul Ramsey)
+ - GT-712, [tiger_geocoder] Strip @extschema:<name>@ schema qualification
+   from the generated install script at build time on PostgreSQL versions
+   below 16, restoring CREATE EXTENSION postgis_tiger_geocoder CASCADE while
+   keeping the qualification on PostgreSQL 16 and newer
+   (Darafei Praliaskouski)
  - #6044, Skip doc XML validation without DocBook XSL stylesheets (Regina Obe)
  - GH-894, [raster] Fix Float16 import, mixed nodata warping,
    band replacement cleanup, GDAL credential redaction, and Python
diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in
index 1844c10d8..435a465b2 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}
@@ -49,8 +56,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 $^ > $@
@@ -198,9 +212,17 @@ 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
+# PG < 16 doesn't support new @extschema:<extension_name>@
+# so we need to strip those out
+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 | 22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list