[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-418-g4ab073b59

git at osgeo.org git at osgeo.org
Wed Dec 21 07:57:18 PST 2022


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  4ab073b59bd6ec066fee7d4e93674720fee129a3 (commit)
      from  fce2bbce55002b0bde1d59939bbf700ac020b4bf (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 4ab073b59bd6ec066fee7d4e93674720fee129a3
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Dec 21 16:56:33 2022 +0100

    New postgis_geos_compiled_version() and exposure in full version
    
    Only shows compiled version in postgis_full_version() output
    if major/minor do not match.
    
    Close #5306

diff --git a/NEWS b/NEWS
index 45262c09d..8871a3072 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ xxxx/xx/xx
   - #5229, Drop support for Proj < 6.1 and PG 11 (Regina Obe)
 
 * New Features *
+  - #5306, expose version of GEOS at compile time (Sandro Santilli)
   - New install-extension-upgrades command in postgis script (Sandro Santilli)
   - #5257, #5261, #5277, Support changes for PostgreSQL 16 (Regina Obe)
   - #5006, GH705, ST_Transform: Support PROJ pipelines (Robert Coup, Koordinates)
diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c
index d94043d53..753873772 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -91,6 +91,7 @@ Datum isring(PG_FUNCTION_ARGS);
 Datum pointonsurface(PG_FUNCTION_ARGS);
 Datum GEOSnoop(PG_FUNCTION_ARGS);
 Datum postgis_geos_version(PG_FUNCTION_ARGS);
+Datum postgis_geos_compiled_version(PG_FUNCTION_ARGS);
 Datum centroid(PG_FUNCTION_ARGS);
 Datum polygonize_garray(PG_FUNCTION_ARGS);
 Datum clusterintersecting_garray(PG_FUNCTION_ARGS);
@@ -122,6 +123,15 @@ Datum postgis_geos_version(PG_FUNCTION_ARGS)
 	PG_RETURN_POINTER(result);
 }
 
+PG_FUNCTION_INFO_V1(postgis_geos_compiled_version);
+Datum postgis_geos_compiled_version(PG_FUNCTION_ARGS)
+{
+	const char *ver = lwgeom_geos_compiled_version();
+	text *result = cstring_to_text(ver);
+	PG_RETURN_POINTER(result);
+}
+
+
 static char
 is_poly(const GSERIALIZED* g)
 {
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 31e7202ae..089863493 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -2951,6 +2951,11 @@ CREATE OR REPLACE FUNCTION postgis_geos_version() RETURNS text
 	AS 'MODULE_PATHNAME'
 	LANGUAGE 'c' IMMUTABLE;
 
+-- Availability: 3.4.0
+CREATE OR REPLACE FUNCTION postgis_geos_compiled_version() RETURNS text
+	AS 'MODULE_PATHNAME'
+	LANGUAGE 'c' IMMUTABLE;
+
 --- Availability: 3.1.0
 CREATE OR REPLACE FUNCTION postgis_lib_revision() RETURNS text
 	AS 'MODULE_PATHNAME'
@@ -3099,6 +3104,7 @@ END
 $$ LANGUAGE plpgsql VOLATILE;
 
 -- Changed: 3.0.0
+-- Changed: 3.4.0 to include geos compiled version
 CREATE OR REPLACE FUNCTION postgis_full_version() RETURNS text
 AS $$
 DECLARE
@@ -3106,6 +3112,7 @@ DECLARE
 	librev text;
 	projver text;
 	geosver text;
+	geosver_compiled text;
 	sfcgalver text;
 	gdalver text := NULL;
 	libxmlver text;
@@ -3128,6 +3135,7 @@ BEGIN
 	SELECT @extschema at .postgis_lib_version() INTO libver;
 	SELECT @extschema at .postgis_proj_version() INTO projver;
 	SELECT @extschema at .postgis_geos_version() INTO geosver;
+	SELECT @extschema at .postgis_geos_compiled_version() INTO geosver_compiled;
 	SELECT @extschema at .postgis_libjson_version() INTO json_lib_ver;
 	SELECT @extschema at .postgis_libprotobuf_version() INTO protobuf_lib_ver;
 	SELECT @extschema at .postgis_wagyu_version() INTO wagyu_lib_ver;
@@ -3214,6 +3222,10 @@ BEGIN
 
 	IF  geosver IS NOT NULL THEN
 		fullver = fullver || ' GEOS="' || geosver || '"';
+		IF (string_to_array(geosver, '.'))[1:2] != (string_to_array(geosver_compiled, '.'))[1:2]
+		THEN
+			fullver = format('%s (compiled against GEOS %s)', fullver, geosver_compiled);
+		END IF;
 	END IF;
 
 	IF  sfcgalver IS NOT NULL THEN

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

Summary of changes:
 NEWS                   |  1 +
 postgis/lwgeom_geos.c  | 10 ++++++++++
 postgis/postgis.sql.in | 12 ++++++++++++
 3 files changed, 23 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list