[postgis-tickets] [SCM] PostGIS branch stable-3.3 updated. 3.3.2-47-g76f44dea8

git at osgeo.org git at osgeo.org
Fri Apr 21 21:17:07 PDT 2023


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  76f44dea83e09101c2fa949b0ad8bfb00494449b (commit)
      from  4bdf7c2af7d3ebd2f85c8bb8dccc8960da7afed3 (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 76f44dea83e09101c2fa949b0ad8bfb00494449b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Dec 13 17:40:47 2022 -0800

    Support build on Pg16devel for PostGIS 3.3.3
    
    Closes #5257
    Closes #5261
    Closes #5277
    Closes #5308
    Closes #5374
    Closes https://github.com/postgis/postgis/pull/716

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 455204ae8..77d0ee04d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -28,6 +28,7 @@ jobs:
         - { tag: pg13-clang-geos39-gdal31-proj71, mode: usan_clang }
         # Run tests with different dependency combinations
         # - { tag: latest, mode: tests }
+        - { tag: latest, mode: coverage }
         - { tag: pg13-geos38-gdal31-proj71, mode: tests }
         - { tag: pg12-geos37-gdal30-proj611, mode: tests }
         - { tag: pg11-geos37-gdal24-proj52, mode: tests }
diff --git a/.gitignore b/.gitignore
index c8e0cce96..8485dcc10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -166,6 +166,7 @@ sfcgal/regress/tests.mk
 sfcgal/*.sql
 sfcgal/sfcgal_upgrade.sql.in
 *.so
+*.dylib
 st_*.png
 .svn
 topology/Makefile
diff --git a/NEWS b/NEWS
index 239e10295..a1a338d26 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,8 @@ YYYY/MM/DD
   - #5331, [postgis_tiger_geocoder] reverse_geocode, prefer addressable ranges
           (Regina Obe, Locance)
   - #5363, Make ST_ClusterDBScan interruptable (Paul Ramsey)
+  - #5257, #5261, #5277, #5308, #5374, Support for PG16
+          (Paul Ramsey, Regina Obe, Sandro Santilli)
 
 
 PostGIS 3.3.2
diff --git a/extensions/address_standardizer/std_pg_hash.c b/extensions/address_standardizer/std_pg_hash.c
index f98ae4e9b..a800a0d8e 100644
--- a/extensions/address_standardizer/std_pg_hash.c
+++ b/extensions/address_standardizer/std_pg_hash.c
@@ -565,7 +565,7 @@ static int parse_rule(char *buf, int *rule)
     TRGT = DatumGetInt32(binval);
 
 #define GET_TEXT_FROM_TUPLE(TRGT,WHICH) \
-    TRGT = DatumGetCString(SPI_getvalue(tuple, tupdesc, WHICH));
+    TRGT = SPI_getvalue(tuple, tupdesc, WHICH);
 
 
 static int fetch_lex_columns(SPITupleTable *tuptable, lex_columns_t *lex_cols)
diff --git a/libpgcommon/lwgeom_pg.c b/libpgcommon/lwgeom_pg.c
index ce8c05543..6af4bea39 100644
--- a/libpgcommon/lwgeom_pg.c
+++ b/libpgcommon/lwgeom_pg.c
@@ -115,7 +115,12 @@ static Oid
 postgis_get_full_version_schema()
 {
 	const char* proname = "postgis_full_version";
+	#if POSTGIS_PGSQL_VERSION < 160
 	List* names = stringToQualifiedNameList(proname);
+	#else
+	List* names = stringToQualifiedNameList(proname, NULL);
+	#endif
+
 	#if POSTGIS_PGSQL_VERSION < 140
 	FuncCandidateList clist = FuncnameGetCandidates(names, -1, NIL, false, false, false);
 	#else
@@ -515,11 +520,15 @@ postgis_guc_find_option(const char *name)
 	 * By equating const char ** with struct config_generic *, we are assuming
 	 * the name field is first in config_generic.
 	 */
+#if POSTGIS_PGSQL_VERSION >= 160
+	res = (struct config_generic **) find_option((void *) &key, false, true, ERROR);
+#else
 	res = (struct config_generic **) bsearch((void *) &key,
 		 (void *) get_guc_variables(),
 		 GetNumConfigOptions(),
 		 sizeof(struct config_generic *),
 		 postgis_guc_var_compare);
+#endif
 
 	/* Found nothing? Good */
 	if ( ! res ) return 0;
diff --git a/libpgcommon/lwgeom_pg.h b/libpgcommon/lwgeom_pg.h
index d14937028..9b817f194 100644
--- a/libpgcommon/lwgeom_pg.h
+++ b/libpgcommon/lwgeom_pg.h
@@ -27,6 +27,11 @@
 #include "liblwgeom.h"
 #include "pgsql_compat.h"
 
+#if POSTGIS_PGSQL_VERSION >= 160
+#include "varatt.h"
+#endif
+
+
 
 /****************************************************************************************/
 
diff --git a/libpgcommon/shared_gserialized.c b/libpgcommon/shared_gserialized.c
index 4b088a966..8513c5a70 100644
--- a/libpgcommon/shared_gserialized.c
+++ b/libpgcommon/shared_gserialized.c
@@ -47,7 +47,12 @@ shared_gserialized_new_cached(FunctionCallInfo fcinfo, Datum d)
 SHARED_GSERIALIZED *
 shared_gserialized_ref(FunctionCallInfo fcinfo, SHARED_GSERIALIZED *ref)
 {
+#if POSTGIS_PGSQL_VERSION >= 160
+/** MemoryContextContains was removed in PG16 **/
+	if ( PostgisCacheContext(fcinfo) == GetMemoryChunkContext(ref) )
+#else
 	if (MemoryContextContains(PostgisCacheContext(fcinfo), ref))
+#endif
 	{
 		ref->count++;
 		return ref;
@@ -65,7 +70,12 @@ shared_gserialized_ref(FunctionCallInfo fcinfo, SHARED_GSERIALIZED *ref)
 void
 shared_gserialized_unref(FunctionCallInfo fcinfo, SHARED_GSERIALIZED *ref)
 {
+#if POSTGIS_PGSQL_VERSION >= 160
+/** MemoryContextContains was removed in PG16 **/
+	if ( PostgisCacheContext(fcinfo) == GetMemoryChunkContext(ref) )
+#else
 	if (MemoryContextContains(PostgisCacheContext(fcinfo), ref))
+#endif
 	{
 		ref->count--;
 		if (!ref->count)
@@ -95,4 +105,4 @@ const GSERIALIZED *
 shared_gserialized_get(SHARED_GSERIALIZED *s)
 {
 	return s->geom;
-}
\ No newline at end of file
+}
diff --git a/postgis/flatgeobuf.c b/postgis/flatgeobuf.c
index 545442f31..e98d6a65b 100644
--- a/postgis/flatgeobuf.c
+++ b/postgis/flatgeobuf.c
@@ -425,6 +425,9 @@ static void decode_properties(struct flatgeobuf_decode_ctx *ctx, Datum *values,
 			fsec_t fsec;
 			int tzp;
 			TimestampTz dttz;
+#if POSTGIS_PGSQL_VERSION >= 160
+			DateTimeErrorExtra extra;
+#endif
 			if (offset + sizeof(len) > size)
 				elog(ERROR, "flatgeobuf: decode_properties: Invalid size for string value");
 			memcpy(&len, data + offset, sizeof(uint32_t));
@@ -432,7 +435,12 @@ static void decode_properties(struct flatgeobuf_decode_ctx *ctx, Datum *values,
 			buf = palloc0(len + 1);
 			memcpy(buf, (const char *) data + offset, len);
 			ParseDateTime((const char *) buf, workbuf, sizeof(workbuf), field, ftype, MAXDATEFIELDS, &nf);
+
+#if POSTGIS_PGSQL_VERSION >= 160
+			DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp, &extra);
+#else
 			DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp);
+#endif
 			tm2timestamp(tm, fsec, &tzp, &dttz);
 			values[ci] = TimestampTzGetDatum(dttz);
 			offset += len;
diff --git a/postgis/gserialized_gist_2d.c b/postgis/gserialized_gist_2d.c
index a47c58d3e..6cca93637 100644
--- a/postgis/gserialized_gist_2d.c
+++ b/postgis/gserialized_gist_2d.c
@@ -1453,11 +1453,11 @@ fallbackSplit(GistEntryVector *entryvec, GIST_SPLITVEC *v)
 
 	if (v->spl_ldatum_exists)
 		adjustBox(unionL, (BOX2DF *) DatumGetPointer(v->spl_ldatum));
-	v->spl_ldatum = BoxPGetDatum(unionL);
+	v->spl_ldatum = PointerGetDatum(unionL);
 
 	if (v->spl_rdatum_exists)
 		adjustBox(unionR, (BOX2DF *) DatumGetPointer(v->spl_rdatum));
-	v->spl_rdatum = BoxPGetDatum(unionR);
+	v->spl_rdatum = PointerGetDatum(unionR);
 
 	v->spl_ldatum_exists = v->spl_rdatum_exists = false;
 }
@@ -2054,7 +2054,7 @@ Datum gserialized_gist_picksplit_2d(PG_FUNCTION_ARGS)
 		{
 			box = (BOX2DF *) DatumGetPointer(entryvec->vector[
 												commonEntries[i].index].key);
-			commonEntries[i].delta = Abs(box2df_penalty(leftBox, box) - box2df_penalty(rightBox, box));
+			commonEntries[i].delta = fabs(box2df_penalty(leftBox, box) - box2df_penalty(rightBox, box));
 		}
 
 		/*
diff --git a/postgis/gserialized_gist_nd.c b/postgis/gserialized_gist_nd.c
index 58c86e3d5..29b6472de 100644
--- a/postgis/gserialized_gist_nd.c
+++ b/postgis/gserialized_gist_nd.c
@@ -1508,7 +1508,7 @@ gserialized_gist_picksplit_constructsplit(GIST_SPLITVEC *v,
 		}
 		else
 		{
-			float p1, p2;
+			float p1 = 0.0, p2 = 0.0;
 			GISTENTRY oldUnion, addon;
 
 			gistentryinit(oldUnion,
diff --git a/postgis/gserialized_spgist_2d.c b/postgis/gserialized_spgist_2d.c
index 8ab682be3..098224a58 100644
--- a/postgis/gserialized_spgist_2d.c
+++ b/postgis/gserialized_spgist_2d.c
@@ -372,7 +372,7 @@ PGDLLEXPORT Datum gserialized_spgist_picksplit_2d(PG_FUNCTION_ARGS)
 
 	/* Fill the output */
 	out->hasPrefix = true;
-	out->prefixDatum = BoxPGetDatum(centroid);
+	out->prefixDatum = PointerGetDatum(centroid);
 
 	out->nNodes = 16;
 	out->nodeLabels = NULL; /* We don't need node labels. */
@@ -564,7 +564,7 @@ PGDLLEXPORT Datum gserialized_spgist_leaf_consistent_2d(PG_FUNCTION_ARGS)
 	int i;
 
 	/* Quick sanity check on entry key. */
-	if (DatumGetPointer(key) == NULL)
+	if (key == NULL)
 	{
 		POSTGIS_DEBUG(4, "[SPGIST] null index entry, returning false");
 		PG_RETURN_BOOL(false); /* NULL entry! */
diff --git a/postgis/lwgeom_box3d.c b/postgis/lwgeom_box3d.c
index 8aec40375..96288e624 100644
--- a/postgis/lwgeom_box3d.c
+++ b/postgis/lwgeom_box3d.c
@@ -464,7 +464,7 @@ PG_FUNCTION_INFO_V1(BOX3D_combine);
 Datum BOX3D_combine(PG_FUNCTION_ARGS)
 {
 	BOX3D *box = (BOX3D *)PG_GETARG_POINTER(0);
-	GSERIALIZED *geom = PG_ARGISNULL(1) ? NULL : (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_POINTER(1));
+	GSERIALIZED *geom = PG_ARGISNULL(1) ? NULL : (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
 	LWGEOM *lwgeom = NULL;
 	BOX3D *result = NULL;
 	GBOX gbox;
diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c
index f4b495703..46aa7446c 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -2503,8 +2503,7 @@ Datum relate_pattern(PG_FUNCTION_ARGS)
 		HANDLE_GEOS_ERROR("Second argument geometry could not be converted to GEOS");
 	}
 
-	patt =  DatumGetCString(DirectFunctionCall1(textout,
-	                        PointerGetDatum(PG_GETARG_DATUM(2))));
+	patt =  DatumGetCString(DirectFunctionCall1(textout, PG_GETARG_DATUM(2)));
 
 	/*
 	** Need to make sure 't' and 'f' are upper-case before handing to GEOS
diff --git a/postgis/lwgeom_triggers.c b/postgis/lwgeom_triggers.c
index 9df48c9af..4293637c4 100644
--- a/postgis/lwgeom_triggers.c
+++ b/postgis/lwgeom_triggers.c
@@ -110,8 +110,7 @@ Datum cache_bbox(PG_FUNCTION_ARGS)
 
 	if ( ! isnull )
 	{
-		out = PointerGetDatum(DirectFunctionCall1(LWGEOM_addBBOX, in));
-
+		out = DirectFunctionCall1(LWGEOM_addBBOX, in);
 		rettuple = SPI_modifytuple(trigdata->tg_relation, rettuple,
 		                           1, &attno, &out, NULL);
 	}
diff --git a/raster/rt_core/rt_band.c b/raster/rt_core/rt_band.c
index fb6e65676..c46ee81f4 100644
--- a/raster/rt_core/rt_band.c
+++ b/raster/rt_core/rt_band.c
@@ -414,7 +414,7 @@ rt_band_get_data(rt_band band) {
 }
 
 /* variable for PostgreSQL GUC: postgis.enable_outdb_rasters */
-char enable_outdb_rasters = 1;
+bool enable_outdb_rasters = true;
 
 /**
 	* Load offline band's data.  Loaded data is internally owned
diff --git a/raster/rt_pg/rtpg_band_properties.c b/raster/rt_pg/rtpg_band_properties.c
index 8ec500a9a..5bc54fc26 100644
--- a/raster/rt_pg/rtpg_band_properties.c
+++ b/raster/rt_pg/rtpg_band_properties.c
@@ -31,8 +31,6 @@
 #define _LARGEFILE64_SOURCE 1
 
 #include <postgres.h>
-#include <fmgr.h>
-#include <funcapi.h>
 #include <utils/builtins.h> /* for text_to_cstring() */
 #include "utils/lsyscache.h" /* for get_typlenbyvalalign */
 #include "utils/array.h" /* for ArrayType */
diff --git a/raster/rt_pg/rtpg_gdal.c b/raster/rt_pg/rtpg_gdal.c
index 9a982f36e..50411c446 100644
--- a/raster/rt_pg/rtpg_gdal.c
+++ b/raster/rt_pg/rtpg_gdal.c
@@ -28,8 +28,6 @@
  */
 
 #include <postgres.h>
-#include <fmgr.h>
-#include <funcapi.h> /* for SRF */
 #include <utils/builtins.h> /* for text_to_cstring() */
 #include <access/htup_details.h> /* for heap_form_tuple() */
 #include <utils/lsyscache.h> /* for get_typlenbyvalalign */
diff --git a/raster/rt_pg/rtpg_inout.c b/raster/rt_pg/rtpg_inout.c
index b959cf204..9bd1aa028 100644
--- a/raster/rt_pg/rtpg_inout.c
+++ b/raster/rt_pg/rtpg_inout.c
@@ -29,7 +29,6 @@
 
 #include <postgres.h>
 #include <fmgr.h>
-
 #include "rtpostgis.h"
 
 Datum RASTER_in(PG_FUNCTION_ARGS);
diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c
index 593f64856..8af585978 100644
--- a/raster/rt_pg/rtpg_mapalgebra.c
+++ b/raster/rt_pg/rtpg_mapalgebra.c
@@ -6007,9 +6007,9 @@ Datum RASTER_mapAlgebraFctNgb(PG_FUNCTION_ARGS)
 
     /* pass the nodata mode into the user function */
 #if POSTGIS_PGSQL_VERSION < 120
-    cbdata.arg[1] = CStringGetDatum(txtCallbackParam);
+    cbdata.arg[1] = PointerGetDatum(txtCallbackParam);
 #else
-    cbdata->args[1].value = CStringGetDatum(txtCallbackParam);
+    cbdata->args[1].value = PointerGetDatum(txtCallbackParam);
 #endif
 
     strFromText = text_to_cstring(txtNodataMode);
diff --git a/raster/rt_pg/rtpostgis.c b/raster/rt_pg/rtpostgis.c
index 08d9955df..2fe1d18bf 100644
--- a/raster/rt_pg/rtpostgis.c
+++ b/raster/rt_pg/rtpostgis.c
@@ -452,8 +452,9 @@ rt_pg_vsi_check_options(char **newval, void **extra, GucSource source)
 
 static char *gdal_datapath = NULL;
 static char *gdal_vsi_options = NULL;
-extern char *gdal_enabled_drivers;
-extern bool enable_outdb_rasters;
+
+static char *gdal_enabled_drivers = NULL;
+static bool enable_outdb_rasters = false;
 
 /* ---------------------------------------------------------------- */
 /*  Useful variables                                                */
diff --git a/raster/rt_pg/rtpostgis.h b/raster/rt_pg/rtpostgis.h
index ef9f2811a..bbf7b9629 100644
--- a/raster/rt_pg/rtpostgis.h
+++ b/raster/rt_pg/rtpostgis.h
@@ -36,8 +36,16 @@
 #undef PACKAGE_TARNAME
 #undef PACKAGE_VERSION
 
+#include "postgres.h"
+#include "fmgr.h"
+#include "funcapi.h"
+
 #include "librtcore.h"
 
+#if POSTGIS_PGSQL_VERSION >= 160
+#include "varatt.h"
+#endif
+
 /* Debugging macros */
 #if POSTGIS_DEBUG_LEVEL > 0
 
diff --git a/regress/core/geos310.sql b/regress/core/geos310.sql
index e56d10b37..905876905 100644
--- a/regress/core/geos310.sql
+++ b/regress/core/geos310.sql
@@ -1,5 +1,5 @@
 -- #168 --
-SELECT '#168', ST_NPoints(g), ST_AsText(g), ST_isValidReason(g)
+SELECT '#168', ST_NPoints(g), ST_AsText(g, 3), left(ST_isValidReason(g),36)
 FROM ( VALUES
 ('01060000C00100000001030000C00100000003000000E3D9107E234F5041A3DB66BC97A30F4122ACEF440DAF9440FFFFFFFFFFFFEFFFE3D9107E234F5041A3DB66BC97A30F4122ACEF440DAF9440FFFFFFFFFFFFEFFFE3D9107E234F5041A3DB66BC97A30F4122ACEF440DAF9440FFFFFFFFFFFFEFFF'::geometry)
 ) AS v(g);
diff --git a/regress/core/geos310_expected b/regress/core/geos310_expected
index f5dc66796..102b04a8b 100644
--- a/regress/core/geos310_expected
+++ b/regress/core/geos310_expected
@@ -1 +1 @@
-#168|3|MULTIPOLYGON ZM (((4275341.969778511 259186.96699306098 1323.762958283311 -1.797693134862316e+308,4275341.969778511 259186.96699306098 1323.762958283311 -1.797693134862316e+308,4275341.969778511 259186.96699306098 1323.762958283311 -1.797693134862316e+308)))|Too few points in geometry component[4275341.96977851 259186.966993061 1323.76295828331]
+#168|3|MULTIPOLYGON ZM (((4275341.97 259186.967 1323.763 -1.798e+308,4275341.97 259186.967 1323.763 -1.798e+308,4275341.97 259186.967 1323.763 -1.798e+308)))|Too few points in geometry component
diff --git a/regress/core/geos312.sql b/regress/core/geos312.sql
new file mode 100644
index 000000000..36a6aa7da
--- /dev/null
+++ b/regress/core/geos312.sql
@@ -0,0 +1,17 @@
+-- #4011
+SELECT '#4011',
+ST_GeometryType(ST_LineMerge(geom)) AS linemerge,
+ST_AsText(geom) AS geom,
+ST_IsEmpty(geom) AS empty,
+ST_IsValid(geom) AS valid
+FROM (VALUES
+('LINESTRING(0 0, 1 1)'),
+('MULTILINESTRING((0 0, 1 1), (1 1, 2 2))'),
+('MULTILINESTRING((0 0, 1 1), EMPTY)'),
+('MULTILINESTRING(EMPTY, EMPTY)'),
+(NULL),
+('POLYGON((0 0, 1 0, 1 1, 0 0))'),
+('GEOMETRYCOLLECTION(LINESTRING(0 0, 1 1))'),
+('MULTILINESTRING EMPTY'),
+('MULTILINESTRING((0 0, 0 0))')
+) as f(geom);
diff --git a/regress/core/geos312_expected b/regress/core/geos312_expected
new file mode 100644
index 000000000..b2f814e75
--- /dev/null
+++ b/regress/core/geos312_expected
@@ -0,0 +1,10 @@
+NOTICE:  Too few points in geometry component at or near point 0 0
+#4011|ST_LineString|LINESTRING(0 0,1 1)|f|t
+#4011|ST_LineString|MULTILINESTRING((0 0,1 1),(1 1,2 2))|f|t
+#4011|ST_LineString|MULTILINESTRING((0 0,1 1),EMPTY)|f|t
+#4011|ST_MultiLineString|MULTILINESTRING(EMPTY,EMPTY)|t|t
+#4011||||
+#4011|ST_LineString|POLYGON((0 0,1 0,1 1,0 0))|f|t
+#4011|ST_LineString|GEOMETRYCOLLECTION(LINESTRING(0 0,1 1))|f|t
+#4011|ST_MultiLineString|MULTILINESTRING EMPTY|t|t
+#4011|ST_GeometryCollection|MULTILINESTRING((0 0,0 0))|f|f
diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in
index 70366505a..8057e8704 100644
--- a/regress/core/tests.mk.in
+++ b/regress/core/tests.mk.in
@@ -182,6 +182,11 @@ else
 		$(top_srcdir)/regress/core/concave_hull
 endif
 
+ifeq ($(shell expr "$(POSTGIS_GEOS_VERSION)" ">=" 31200),1)
+	TESTS += \
+		$(top_srcdir)/regress/core/geos312
+endif
+
 ifeq ($(INTERRUPTTESTS),yes)
 	# Allow CI servers to configure --with-interrupt-tests
 	TESTS += \
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index 9e0266426..0fb668426 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1054,23 +1054,7 @@ DROP TABLE IF EXISTS rec;
 -- #3930
 SELECT '#3930', round(1000*st_area(st_minimumboundingcircle('MULTIPOLYGON (((-76.5442733764648 34.5878295898438, -76.5551452636719 34.6106605529785, -76.5377502441406 34.6139221191406, -76.4844818115234 34.6976318359375, -76.4322967529297 34.760684967041, -76.3746795654297 34.8128700256348, -76.2877044677734 34.877010345459, -76.4692611694336 34.6932830810547, -76.5442733764648 34.5878295898438)), ((-76.0170059204102 35.0694351196289, -75.9756927490234 35.1161842346191, -75.8539352416992 35.1672821044922, -75.7637023925781 35.1922836303711, -75.8115386962891 35.1640205383301, -75.9039459228516 35.1324920654297, -76.0028762817383 35.0694351196289, -76.0170059204102 35.0694351196289)), ((-76.0271682739258 36.5567169189453, -75.998664855957 36.5566520690918, -75.9119186401367 36.5425300598145, -75.9248046875 36.4739761352539, -75.9772796630859 36.4780158996582, -75.9762878417969 36.5179252624512, -76.0271682739258 36.5567169189453)), ((-75.4912185668945 35.6704978942871, -75.5336227416
 992 35.768856048584, -75.4569778442383 35.6173973083496, -75.5262985229492 35.2279167175293, -75.7492904663086 35.189826965332, -75.6915664672852 35.2349891662598, -75.521484375 35.2813568115234, -75.4754180908203 35.5644950866699, -75.4912185668945 35.6704978942871)), ((-83.9379959106445 34.9893913269043, -83.9885482788086 34.9890670776367, -84.1182403564453 34.988224029541, -84.3238525390625 34.9890098571777, -84.2910385131836 35.2105445861816, -84.225944519043 35.261604309082, -84.1797256469727 35.2409896850586, -84.1016464233398 35.2455520629883, -84.0427780151367 35.272575378418, -84.0308609008789 35.2925224304199, -84.0292053222656 35.3252906799316, -84.0063095092773 35.372859954834, -84.0126495361328 35.4076232910156, -83.954704284668 35.4554595947266, -83.9100112915039 35.4764785766602, -83.8812255859375 35.5105857849121, -83.8302001953125 35.5190620422363, -83.77587890625 35.552604675293, -83.6728744506836 35.5649719238281, -83.6138610839844 35.5717391967773, -83.5610351562
 5 35.55517578125, -83.5057983398438 35.5595512390137, -83.4582901000977 35.5972785949707, -83.387092590332 35.6252174377441, -83.3430252075195 35.6532592773438, -83.2984161376953 35.6563262939453, -83.2591247558594 35.6910095214844, -83.253303527832 35.7007064819336, -83.2438507080078 35.7182159423828, -83.1853485107422 35.7288856506348, -83.1436614990234 35.7626838684082, -83.1181869506836 35.7638092041016, -83.0599594116211 35.7825775146484, -82.9870071411133 35.7739906311035, -82.9627532958984 35.7918510437012, -82.9068222045898 35.8722152709961, -82.9140701293945 35.9278678894043, -82.8959732055664 35.9483604431152, -82.8562698364258 35.9474258422852, -82.8086700439453 35.9208717346191, -82.7764434814453 35.9565734863281, -82.7735977172852 35.9875030517578, -82.7632293701172 35.9995460510254, -82.6438903808594 36.0517234802246, -82.628044128418 36.0543403625488, -82.6044006347656 36.0429878234863, -82.5922317504883 36.0224494934082, -82.6058044433594 36.003547668457, -82.5993041
 992188 35.9632987976074, -82.5541458129883 35.9561080932617, -82.5069351196289 35.972541809082, -82.4751968383789 35.9931755065918, -82.4084243774414 36.0753173828125, -82.3738555908203 36.0986976623535, -82.3119277954102 36.1221504211426, -82.2623062133789 36.1203765869141, -82.2077331542969 36.1470146179199, -82.154052734375 36.1396217346191, -82.1180801391602 36.0962562561035, -82.0777587890625 36.1001396179199, -82.0204544067383 36.129711151123, -81.9331130981445 36.2633209228516, -81.9111557006836 36.2907524108887, -81.8305740356445 36.3346557617188, -81.7304916381836 36.3293418884277, -81.7094573974609 36.3337249755859, -81.7403793334961 36.3618583679199, -81.7410736083984 36.3917846679688, -81.6982803344727 36.4717788696289, -81.7027969360352 36.5193405151367, -81.6699981689453 36.5896492004395, -81.3452987670898 36.5728645324707, -80.9034423828125 36.5652122497559, -80.8381576538086 36.5634384155273, -80.6110534667969 36.5572967529297, -80.4353103637695 36.5510444641113, -80
 .048095703125 36.5471343994141, -80.024055480957 36.5450248718262, -79.7174453735352 36.5478897094727, -79.5102996826172 36.5476570129395, -79.2170639038086 36.5497817993164, -79.1443252563477 36.5460586547852, -78.7966995239258 36.5435333251953, -78.7373886108398 36.5460739135742, -78.4588088989258 36.5414810180664, -78.3212509155273 36.5455322265625, -78.0516662597656 36.5524749755859, -77.8988571166992 36.5529441833496, -77.7639312744141 36.5534400939941, -77.3200531005859 36.5539169311523, -77.1773529052734 36.5562858581543, -76.9241333007812 36.5541458129883, -76.921630859375 36.5541572570801, -76.5635833740234 36.5552520751953, -76.49755859375 36.5558128356934, -76.3302536010742 36.5560569763184, -76.1273956298828 36.5571632385254, -76.0459594726562 36.5569534301758, -76.0332107543945 36.5143737792969, -76.091064453125 36.5035667419434, -75.97607421875 36.4362144470215, -75.9697647094727 36.4151191711426, -76.0016098022461 36.4189147949219, -75.9512557983398 36.3654708862305, 
 -75.9281234741211 36.4232444763184, -75.9245910644531 36.3509483337402, -75.8000564575195 36.1128158569336, -75.7988510131836 36.0728187561035, -75.8551635742188 36.1056671142578, -75.9137649536133 36.244800567627, -75.9575119018555 36.2594528198242, -75.9419326782227 36.2943382263184, -76.0089721679688 36.3195953369141, -75.9571838378906 36.1937713623047, -75.9813385009766 36.1697273254395, -76.1831665039062 36.3152389526367, -76.2189025878906 36.2966079711914, -76.1127090454102 36.1744194030762, -76.1419372558594 36.1476898193359, -76.234977722168 36.1633605957031, -76.2989273071289 36.2142295837402, -76.275505065918 36.1103706359863, -76.4805297851562 36.0797920227051, -76.4204254150391 36.0586051940918, -76.5230102539062 36.0071678161621, -76.5940017700195 36.0101318359375, -76.6490173339844 36.0657081604004, -76.6332092285156 36.0371170043945, -76.6901550292969 36.0496101379395, -76.7265090942383 36.1568222045898, -76.6887359619141 36.2945175170898, -76.7766418457031 36.3583297
 729492, -76.9240798950195 36.3924446105957, -76.7413482666016 36.3151664733887, -76.7074966430664 36.2661323547363, -76.7450637817383 36.2339172363281, -76.7606735229492 36.1445922851562, -76.6937637329102 35.9929695129395, -76.7411270141602 35.9366264343262, -76.6972198486328 35.9415435791016, -76.4094696044922 35.977466583252, -76.3714828491211 35.9323425292969, -76.2137680053711 35.9768753051758, -76.0896377563477 35.9629135131836, -76.0260467529297 35.9204254150391, -76.0759124755859 35.7568016052246, -76.0430679321289 35.6838493347168, -76.1673049926758 35.6968421936035, -76.1047439575195 35.6636390686035, -76.0212097167969 35.6690940856934, -75.9878540039062 35.892707824707, -75.8180541992188 35.9235191345215, -75.7489624023438 35.8693389892578, -75.7293701171875 35.6651725769043, -75.779052734375 35.578685760498, -75.8914947509766 35.6312675476074, -76.052978515625 35.4146041870117, -76.1816177368164 35.3415336608887, -76.4988021850586 35.4162178039551, -76.5337524414062 35.4
 501991271973, -76.4584350585938 35.5044250488281, -76.4465255737305 35.5508651733398, -76.5189437866211 35.5776443481445, -76.4925384521484 35.5417861938477, -76.6381988525391 35.520336151123, -76.6287689208984 35.4378967285156, -76.7053756713867 35.4119338989258, -77.1037673950195 35.5501861572266, -76.9831848144531 35.4365005493164, -76.6949005126953 35.3504257202148, -76.6145172119141 35.2729187011719, -76.5912094116211 35.3120803833008, -76.5409774780273 35.3036880493164, -76.5071258544922 35.2487678527832, -76.6400909423828 35.1725196838379, -76.605224609375 35.1385612487793, -76.6242218017578 35.0643501281738, -76.6780090332031 35.0240859985352, -76.8494644165039 34.9822196960449, -76.9414901733398 35.0274276733398, -76.943244934082 35.0700340270996, -77.0478820800781 35.092155456543, -77.1046752929688 35.0879859924316, -77.1105880737305 35.0660362243652, -77.0011901855469 35.0528869628906, -76.9131088256836 34.9364700317383, -76.6470489501953 34.9063339233398, -76.67005920410
 16 34.9699974060059, -76.5297775268555 34.9746360778809, -76.4450302124023 35.016658782959, -76.4240570068359 34.9462471008301, -76.364013671875 34.9431114196777, -76.3294067382812 34.9759559631348, -76.3147125244141 34.9488143920898, -76.4699020385742 34.7850608825684, -76.6253128051758 34.7197532653809, -77.0505294799805 34.698917388916, -77.1489562988281 34.764331817627, -77.12939453125 34.6849136352539, -77.1566009521484 34.6606369018555, -77.5386352539062 34.4570083618164, -77.5867614746094 34.4209365844727, -77.6097259521484 34.4350433349609, -77.6026153564453 34.4126281738281, -77.7505264282227 34.305046081543, -77.864387512207 34.1927375793457, -77.894401550293 34.0691795349121, -77.9267578125 34.0620346069336, -77.9607315063477 34.1892433166504, -77.9585266113281 33.9925804138184, -78.0348052978516 33.9142913818359, -78.579719543457 33.8819923400879, -78.6557159423828 33.948673248291, -79.0745010375977 34.304573059082, -79.4471435546875 34.6190605163574, -79.4559707641602 3
 4.634090423584, -79.6675033569336 34.8006629943848, -79.6859588623047 34.8052558898926, -79.9199523925781 34.807918548584, -80.3252792358398 34.8147621154785, -80.5615463256836 34.8152275085449, -80.8000640869141 34.8161125183105, -80.7856521606445 34.9406394958496, -80.8401641845703 35.0020179748535, -80.8947143554688 35.0597343444824, -80.9277954101562 35.1012496948242, -81.0398864746094 35.0372009277344, -81.0655517578125 35.0664825439453, -81.0284423828125 35.1054077148438, -81.0490417480469 35.1320114135742, -81.0493011474609 35.1515312194824, -81.3228225708008 35.1637573242188, -81.362174987793 35.1628532409668, -81.7653579711914 35.1824722290039, -81.8705902099609 35.1831169128418, -81.9714431762695 35.1882820129395, -82.2101745605469 35.1931266784668, -82.2783279418945 35.1950073242188, -82.3207702636719 35.1841888427734, -82.3508605957031 35.1926727294922, -82.3601226806641 35.1829490661621, -82.3713760375977 35.1827239990234, -82.3896102905273 35.2082405090332, -82.4379196
 166992 35.1695594787598, -82.4667434692383 35.1735000610352, -82.5246353149414 35.1545600891113, -82.5700302124023 35.1494903564453, -82.6544952392578 35.119457244873, -82.6860504150391 35.1214637756348, -82.6880340576172 35.0978012084961, -82.6973571777344 35.0912322998047, -82.7713470458984 35.0854225158691, -82.8876953125 35.0553703308105, -83.0072784423828 35.0242042541504, -83.1062850952148 35.0002784729004, -83.5130081176758 34.9920234680176, -83.5494155883789 34.9895362854004, -83.9379959106445 34.9893913269043)), ((-75.7731552124023 36.2292556762695, -75.5449676513672 35.7883605957031, -75.7027359008789 36.049861907959, -75.7408676147461 36.0503234863281, -75.7831726074219 36.2251930236816, -75.901985168457 36.5561981201172, -75.8781661987305 36.5558738708496, -75.7731552124023 36.2292556762695)))')));
 
--- #4011
-SELECT '#4011',
-ST_GeometryType(ST_LineMerge(geom)) AS linemerge,
-ST_AsText(geom) AS geom,
-ST_IsEmpty(geom) AS empty,
-ST_IsValid(geom) AS valid
-FROM (VALUES
-('LINESTRING(0 0, 1 1)'),
-('MULTILINESTRING((0 0, 1 1), (1 1, 2 2))'),
-('MULTILINESTRING((0 0, 1 1), EMPTY)'),
-('MULTILINESTRING(EMPTY, EMPTY)'),
-(NULL),
-('POLYGON((0 0, 1 0, 1 1, 0 0))'),
-('GEOMETRYCOLLECTION(LINESTRING(0 0, 1 1))'),
-('MULTILINESTRING EMPTY'),
-('MULTILINESTRING((0 0, 0 0))')
-) as f(geom);
+
 
 -- #4025
 select '#4025', ST_DistanceCPA (
@@ -1460,8 +1444,16 @@ CREATE TABLE a AS
 SELECT x AS id, ST_Point(40000 + 10000, -100000 , 27700) AS geom
 FROM generate_series(1,1000000) AS x ;
 
+/** PG16 force_parallel_mode was renamed to debug_parallel_query, thus the need for this procedure **/
+CREATE OR REPLACE PROCEDURE p_force_parellel_mode(param_state text) language plpgsql AS
+$$
+BEGIN
+	UPDATE pg_settings SET setting = param_state WHERE name IN('debug_parallel_query','force_parallel_mode');
+END;
+$$;
+
 set max_parallel_workers_per_gather=3;
-set force_parallel_mode=on;
+CALL p_force_parellel_mode('on');
 DROP TABLE IF EXISTS object_list_temp;
 WITH object_list AS (
 	SELECT '#5139'::text AS t, id, to_jsonb(geom) AS json_data
@@ -1475,10 +1467,14 @@ SELECT t, id FROM object_list_temp ORDER BY id;
 DROP TABLE IF EXISTS object_list_temp;
 DROP TABLE IF EXISTS a;
 reset max_parallel_workers_per_gather;
-reset force_parallel_mode;
+
+CALL p_force_parellel_mode('off');
+
 
 SET client_min_messages TO NOTICE;
 -- https://trac.osgeo.org/postgis/ticket/5315
 SELECT '#5315', ST_Buffer('0106000020E86400000100000001030000000100000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geometry, 1);
 
 SELECT '#5320', ST_SimplifyPreserveTopology('0106000020E86400000100000001030000000100000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geometry, 1);
+
+DROP PROCEDURE IF EXISTS p_force_parellel_mode(text);
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 23d969b7e..63aa2ae5b 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -314,16 +314,6 @@ NOTICE:  Hole lies outside shell at or near point 25495368.044100001 6671726.931
 #1014d|SRID=1;POINT(0 1)
 #1014d|SRID=2;POINT(0 1)
 #3930|62065
-NOTICE:  Too few points in geometry component at or near point 0 0
-#4011|ST_LineString|LINESTRING(0 0,1 1)|f|t
-#4011|ST_LineString|MULTILINESTRING((0 0,1 1),(1 1,2 2))|f|t
-#4011|ST_LineString|MULTILINESTRING((0 0,1 1),EMPTY)|f|t
-#4011|ST_MultiLineString|MULTILINESTRING(EMPTY,EMPTY)|t|t
-#4011||||
-#4011|ST_GeometryCollection|POLYGON((0 0,1 0,1 1,0 0))|f|t
-#4011|ST_LineString|GEOMETRYCOLLECTION(LINESTRING(0 0,1 1))|f|t
-#4011|ST_MultiLineString|MULTILINESTRING EMPTY|t|t
-#4011|ST_GeometryCollection|MULTILINESTRING((0 0,0 0))|f|f
 #4025|
 #4037.1|lwgeom_intersection_prec: GEOS Error: TopologyException
 #4037.2|lwgeom_difference_prec: GEOS Error: TopologyException
diff --git a/regress/core/union.sql b/regress/core/union.sql
index 5a19602c8..41bc1251c 100644
--- a/regress/core/union.sql
+++ b/regress/core/union.sql
@@ -35,7 +35,15 @@ SELECT ST_AsText(ST_Union(geom)) FROM geoms;
 
 TRUNCATE TABLE geoms;
 
-SET force_parallel_mode = on;
+/** PG16 force_parallel_mode was renamed to debug_parallel_query, thus the need for this procedure **/
+CREATE OR REPLACE PROCEDURE p_force_parellel_mode(param_state text) language plpgsql AS
+$$
+BEGIN
+	UPDATE pg_settings SET setting = param_state WHERE name IN('debug_parallel_query','force_parallel_mode');
+END;
+$$;
+
+CALL p_force_parellel_mode('on');
 SET parallel_setup_cost = 0;
 SET parallel_tuple_cost = 0;
 SET min_parallel_table_scan_size = 0;
@@ -67,3 +75,5 @@ SELECT ST_AsText(ST_Union(geom)) FROM geoms;
 
 
 DROP TABLE geoms;
+CALL p_force_parellel_mode('off');
+DROP PROCEDURE IF EXISTS p_force_parellel_mode(text);

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

Summary of changes:
 .github/workflows/ci.yml                      |  1 +
 .gitignore                                    |  1 +
 NEWS                                          |  2 ++
 extensions/address_standardizer/std_pg_hash.c |  2 +-
 libpgcommon/lwgeom_pg.c                       |  9 +++++++
 libpgcommon/lwgeom_pg.h                       |  5 ++++
 libpgcommon/shared_gserialized.c              | 12 +++++++++-
 postgis/flatgeobuf.c                          |  8 +++++++
 postgis/gserialized_gist_2d.c                 |  6 ++---
 postgis/gserialized_gist_nd.c                 |  2 +-
 postgis/gserialized_spgist_2d.c               |  4 ++--
 postgis/lwgeom_box3d.c                        |  2 +-
 postgis/lwgeom_geos.c                         |  3 +--
 postgis/lwgeom_triggers.c                     |  3 +--
 raster/rt_core/rt_band.c                      |  2 +-
 raster/rt_pg/rtpg_band_properties.c           |  2 --
 raster/rt_pg/rtpg_gdal.c                      |  2 --
 raster/rt_pg/rtpg_inout.c                     |  1 -
 raster/rt_pg/rtpg_mapalgebra.c                |  4 ++--
 raster/rt_pg/rtpostgis.c                      |  5 ++--
 raster/rt_pg/rtpostgis.h                      |  8 +++++++
 regress/core/geos310.sql                      |  2 +-
 regress/core/geos310_expected                 |  2 +-
 regress/core/geos312.sql                      | 17 ++++++++++++++
 regress/core/geos312_expected                 | 10 ++++++++
 regress/core/tests.mk.in                      |  5 ++++
 regress/core/tickets.sql                      | 34 ++++++++++++---------------
 regress/core/tickets_expected                 | 10 --------
 regress/core/union.sql                        | 12 +++++++++-
 29 files changed, 121 insertions(+), 55 deletions(-)
 create mode 100644 regress/core/geos312.sql
 create mode 100644 regress/core/geos312_expected


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list