[SCM] PostGIS branch stable-3.6 updated. 3.6.0-4-gb06d5e2db

git at osgeo.org git at osgeo.org
Wed Sep 17 11:56:27 PDT 2025


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.6 has been updated
       via  b06d5e2dbacb89b7e3302754c0ad55be6de6e53b (commit)
      from  d1f739e438913c9e72c0711ab945ea514299ed31 (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 b06d5e2dbacb89b7e3302754c0ad55be6de6e53b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Sep 17 11:56:22 2025 -0700

    ST_GeometryN fails for non-collections, references #5987

diff --git a/NEWS b/NEWS
index b322a4f0b..16967a888 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,8 @@ PostGIS 3.6.1
 
 * Fixes *
 
-  - #5978, geometry_columns needs to still parse table constraints  
+  - #5978, geometry_columns needs to still parse table constraints (Paul Ramsey)
+  - #5987, ST_GeometryN fails for non-collections (Paul Ramsey)  
 
 
 PostGIS 3.6.0
diff --git a/postgis/lwgeom_ogc.c b/postgis/lwgeom_ogc.c
index d38fb1390..d58903892 100644
--- a/postgis/lwgeom_ogc.c
+++ b/postgis/lwgeom_ogc.c
@@ -384,20 +384,14 @@ Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS)
 	if (!subgeom)
 		PG_RETURN_NULL();
 
-	/* If returning the original geometry */
-	if (subgeom == lwgeom)
+	/* If not returning the original geometry */
+	if (subgeom != lwgeom)
 	{
-		lwgeom_free(lwgeom);
-		PG_FREE_IF_COPY(geom, 0);
-		PG_RETURN_POINTER(geom);
+		subgeom->srid = lwgeom->srid;
+		/* COMPUTE_BBOX==TAINTING */
+		if (lwgeom->bbox) lwgeom_add_bbox(subgeom);
 	}
-
-	subgeom->srid = lwgeom->srid;
-	/* COMPUTE_BBOX==TAINTING */
-	if (lwgeom->bbox) lwgeom_add_bbox(subgeom);
-
 	result = geometry_serialize(subgeom);
-	lwgeom_free(lwgeom);
 	PG_FREE_IF_COPY(geom, 0);
 	PG_RETURN_POINTER(result);
 }

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

Summary of changes:
 NEWS                 |  3 ++-
 postgis/lwgeom_ogc.c | 16 +++++-----------
 2 files changed, 7 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list