[SCM] PostGIS branch master updated. 3.6.0rc2-636-g986bb6a1a

git at osgeo.org git at osgeo.org
Sat Jun 20 13:09:35 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, master has been updated
       via  986bb6a1a6a133be10c234b8b04bd7bf1025fa05 (commit)
      from  ea6edb5d5a44804bd0e3d2d05d76b220134fae1f (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 986bb6a1a6a133be10c234b8b04bd7bf1025fa05
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Sat Jun 20 23:58:59 2026 +0400

    Clarify newer component script version reporting
    
    Compare installed topology, raster, and SFCGAL script versions against the core script version using PostGIS version suffix ordering: dev < alpha < beta < rc < final. When component scripts are newer than core scripts, report that direction explicitly instead of saying the component procs need upgrade.
    
    Closes #2808
    
    Closes https://github.com/postgis/postgis/pull/1057

diff --git a/NEWS b/NEWS
index e84f23d2a..121538c26 100644
--- a/NEWS
+++ b/NEWS
@@ -106,6 +106,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
  - GH-888, [sfcgal] Avoid stale detoasted geometry access in
           CG_Visibility empty-input handling for SFCGAL < 2.2
           (Darafei Praliaskouski)
+ - #2808, Clarify postgis_full_version() output when installed component
+          scripts are newer than core scripts (Darafei Praliaskouski)
  - #3179, Mark truncated libpgcommon PostgreSQL messages instead of silently
           dropping the tail (Darafei Praliaskouski)
  - #6003, Avoid size_t formats in liblwgeom logging/error wrappers for
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 7e5cd081b..8abfd90a2 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -3153,6 +3153,42 @@ CREATE OR REPLACE FUNCTION postgis_scripts_released() RETURNS text
 	AS 'MODULE_PATHNAME'
 	LANGUAGE 'c' IMMUTABLE;
 
+CREATE OR REPLACE FUNCTION _postgis_scripts_version_cmp_key(ver text)
+	RETURNS int[]
+	AS $$
+	DECLARE
+		ver_match text[];
+	BEGIN
+		ver_match := pg_catalog.regexp_match(
+			pg_catalog.lower(ver),
+			'^([0-9]+)\.([0-9]+)\.([0-9]+)(dev|alpha|beta|rc)?([0-9]*)([^0-9a-z].*)?$'
+		);
+		IF ver_match IS NULL THEN
+			RETURN NULL;
+		END IF;
+
+		RETURN ARRAY[
+			ver_match[1]::int,
+			ver_match[2]::int,
+			ver_match[3]::int,
+			CASE coalesce(ver_match[4], '')
+				WHEN 'dev' THEN 0
+				WHEN 'alpha' THEN 1
+				WHEN 'beta' THEN 2
+				WHEN 'rc' THEN 3
+				ELSE 4
+			END,
+			CASE coalesce(ver_match[5], '')
+				WHEN '' THEN 0
+				ELSE ver_match[5]::int
+			END
+		];
+	EXCEPTION WHEN OTHERS THEN
+		RETURN NULL;
+	END
+	$$
+	LANGUAGE 'plpgsql' IMMUTABLE STRICT;
+
 CREATE OR REPLACE FUNCTION postgis_geos_version() RETURNS text
 	AS 'MODULE_PATHNAME'
 	LANGUAGE 'c' IMMUTABLE;
@@ -3326,6 +3362,8 @@ DECLARE
 	rast_lib_ver text := NULL;
 	rast_scr_ver text := NULL;
 	topo_scr_ver text := NULL;
+	relproc_int int[];
+	scr_ver_int int[];
 	json_lib_ver text;
 	protobuf_lib_ver text;
 	wagyu_lib_ver text;
@@ -3368,6 +3406,7 @@ BEGIN
 	SELECT @extschema at .postgis_scripts_installed() INTO dbproc;
 	SELECT @extschema at .postgis_scripts_released() INTO relproc;
 	SELECT @extschema at .postgis_lib_revision() INTO librev;
+	SELECT @extschema at ._postgis_scripts_version_cmp_key(relproc) INTO relproc_int;
 	BEGIN
 		SELECT topology.postgis_topology_scripts_installed() INTO topo_scr_ver;
 	EXCEPTION
@@ -3471,7 +3510,18 @@ BEGIN
 	IF topo_scr_ver IS NOT NULL THEN
 		fullver = fullver || ' TOPOLOGY';
 		IF topo_scr_ver != relproc THEN
-			fullver = fullver || ' (topology procs from "' || topo_scr_ver || '" need upgrade)';
+			SELECT @extschema at ._postgis_scripts_version_cmp_key(topo_scr_ver) INTO scr_ver_int;
+
+			IF scr_ver_int IS NOT NULL AND relproc_int IS NOT NULL AND scr_ver_int > relproc_int THEN
+				fullver = pg_catalog.format(
+					'%s (topology procs from "%s" are newer than core procs from "%s")',
+					fullver,
+					topo_scr_ver,
+					relproc
+				);
+			ELSE
+				fullver = fullver || ' (topology procs from "' || topo_scr_ver || '" need upgrade)';
+			END IF;
 		END IF;
 		IF core_is_extension AND NOT EXISTS (
 			SELECT * FROM pg_catalog.pg_extension
@@ -3495,11 +3545,33 @@ BEGIN
 	END IF;
 
 	IF rast_scr_ver IS NOT NULL AND rast_scr_ver != relproc THEN
-		fullver = fullver || ' (raster procs from "' || rast_scr_ver || '" need upgrade)';
+		SELECT @extschema at ._postgis_scripts_version_cmp_key(rast_scr_ver) INTO scr_ver_int;
+
+		IF scr_ver_int IS NOT NULL AND relproc_int IS NOT NULL AND scr_ver_int > relproc_int THEN
+			fullver = pg_catalog.format(
+				'%s (raster procs from "%s" are newer than core procs from "%s")',
+				fullver,
+				rast_scr_ver,
+				relproc
+			);
+		ELSE
+			fullver = fullver || ' (raster procs from "' || rast_scr_ver || '" need upgrade)';
+		END IF;
 	END IF;
 
 	IF sfcgal_scr_ver IS NOT NULL AND sfcgal_scr_ver != relproc THEN
-		fullver = fullver || ' (sfcgal procs from "' || sfcgal_scr_ver || '" need upgrade)';
+		SELECT @extschema at ._postgis_scripts_version_cmp_key(sfcgal_scr_ver) INTO scr_ver_int;
+
+		IF scr_ver_int IS NOT NULL AND relproc_int IS NOT NULL AND scr_ver_int > relproc_int THEN
+			fullver = pg_catalog.format(
+				'%s (sfcgal procs from "%s" are newer than core procs from "%s")',
+				fullver,
+				sfcgal_scr_ver,
+				relproc
+			);
+		ELSE
+			fullver = fullver || ' (sfcgal procs from "' || sfcgal_scr_ver || '" need upgrade)';
+		END IF;
 	END IF;
 
 	-- Check for the presence of deprecated functions
diff --git a/regress/core/postgis_full_version.sql b/regress/core/postgis_full_version.sql
new file mode 100644
index 000000000..88e9a3c62
--- /dev/null
+++ b/regress/core/postgis_full_version.sql
@@ -0,0 +1,76 @@
+BEGIN;
+
+DO $$
+BEGIN
+	IF NOT EXISTS (
+		SELECT 1
+		FROM pg_catalog.pg_namespace
+		WHERE nspname = 'topology'
+	) THEN
+		CREATE SCHEMA topology;
+	END IF;
+END;
+$$;
+
+CREATE OR REPLACE FUNCTION postgis_scripts_released()
+RETURNS text
+AS $$ SELECT '3.7.0rc1'::text AS version $$
+LANGUAGE 'sql' IMMUTABLE;
+
+CREATE OR REPLACE FUNCTION topology.postgis_topology_scripts_installed()
+RETURNS text
+AS $$ SELECT '1.0.0'::text AS version $$
+LANGUAGE 'sql' IMMUTABLE;
+
+-- Older component script versions still mean the installed procs need upgrade.
+SELECT 'topology_old_scripts',
+	postgis_full_version() ~
+		'TOPOLOGY \(topology procs from "1\.0\.0" need upgrade\)';
+
+CREATE OR REPLACE FUNCTION topology.postgis_topology_scripts_installed()
+RETURNS text
+AS $$ SELECT '3.7.0'::text AS version $$
+LANGUAGE 'sql' IMMUTABLE;
+
+CREATE OR REPLACE FUNCTION postgis_raster_scripts_installed()
+RETURNS text
+AS $$ SELECT '3.7.0rc2'::text AS version $$
+LANGUAGE 'sql' IMMUTABLE;
+
+CREATE OR REPLACE FUNCTION postgis_sfcgal_full_version()
+RETURNS text
+AS $$ SELECT '999.0.0dev'::text AS version $$
+LANGUAGE 'sql' IMMUTABLE;
+
+CREATE OR REPLACE FUNCTION postgis_sfcgal_scripts_installed()
+RETURNS text
+AS $$ SELECT '3.7.0beta1'::text AS version $$
+LANGUAGE 'sql' IMMUTABLE;
+
+-- Newer component script versions are intentional in mixed-script installs:
+-- report them as newer than core, not as something that needs upgrade. This
+-- includes final releases newer than release candidates and later RCs.
+SELECT 'topology_newer_scripts',
+	postgis_full_version() ~
+		'TOPOLOGY \(topology procs from "3\.7\.0" are newer than core procs from "3\.7\.0rc1"\)';
+
+SELECT 'raster_newer_scripts',
+	postgis_full_version() ~
+		'\(raster procs from "3\.7\.0rc2" are newer than core procs from "3\.7\.0rc1"\)';
+
+-- A prerelease older than the core prerelease is still reported as needing
+-- upgrade, even when its numeric major/minor/micro components match.
+SELECT 'sfcgal_older_prerelease',
+	postgis_full_version() ~
+		'\(sfcgal procs from "3\.7\.0beta1" need upgrade\)';
+
+CREATE OR REPLACE FUNCTION postgis_sfcgal_scripts_installed()
+RETURNS text
+AS $$ SELECT '3.7.0'::text AS version $$
+LANGUAGE 'sql' IMMUTABLE;
+
+SELECT 'sfcgal_newer_scripts',
+	postgis_full_version() ~
+		'\(sfcgal procs from "3\.7\.0" are newer than core procs from "3\.7\.0rc1"\)';
+
+ROLLBACK;
diff --git a/regress/core/postgis_full_version_expected b/regress/core/postgis_full_version_expected
new file mode 100644
index 000000000..8e3e2c8cd
--- /dev/null
+++ b/regress/core/postgis_full_version_expected
@@ -0,0 +1,5 @@
+topology_old_scripts|t
+topology_newer_scripts|t
+raster_newer_scripts|t
+sfcgal_older_prerelease|t
+sfcgal_newer_scripts|t
diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in
index b6a87b629..73426ab2a 100644
--- a/regress/core/tests.mk.in
+++ b/regress/core/tests.mk.in
@@ -91,6 +91,7 @@ TESTS += \
 	$(top_srcdir)/regress/core/point_coordinates \
 	$(top_srcdir)/regress/core/polygonize \
 	$(top_srcdir)/regress/core/polyhedralsurface \
+	$(top_srcdir)/regress/core/postgis_full_version \
 	$(top_srcdir)/regress/core/postgis_type_name \
 	$(top_srcdir)/regress/core/quantize_coordinates \
 	$(top_srcdir)/regress/core/regress \

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

Summary of changes:
 NEWS                                       |  2 +
 postgis/postgis.sql.in                     | 78 ++++++++++++++++++++++++++++--
 regress/core/postgis_full_version.sql      | 76 +++++++++++++++++++++++++++++
 regress/core/postgis_full_version_expected |  5 ++
 regress/core/tests.mk.in                   |  1 +
 5 files changed, 159 insertions(+), 3 deletions(-)
 create mode 100644 regress/core/postgis_full_version.sql
 create mode 100644 regress/core/postgis_full_version_expected


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list