[Git][debian-gis-team/postgis][upstream] New upstream version 3.5.2+dfsg
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Sun Jan 19 06:48:45 GMT 2025
Bas Couwenberg pushed to branch upstream at Debian GIS Project / postgis
Commits:
5e426605 by Bas Couwenberg at 2025-01-19T07:34:37+01:00
New upstream version 3.5.2+dfsg
- - - - -
18 changed files:
- ChangeLog
- NEWS
- Version.config
- doc/release_notes.xml
- extensions/address_standardizer/Makefile
- extensions/upgradeable_versions.mk
- postgis/brin_2d.c
- postgis/brin_nd.c
- postgis/geography_brin.sql.in
- postgis/lwgeom_geos.c
- postgis/postgis_after_upgrade.sql
- postgis/postgis_brin.sql.in
- postgis_revision.h
- regress/core/regress_brin_index.sql
- regress/core/regress_brin_index_3d.sql
- regress/core/regress_brin_index_geography.sql
- sfcgal/Makefile.in
- + sfcgal/postgis_sfcgal_legacy.c
Changes:
=====================================
ChangeLog
=====================================
@@ -1,3 +1,45 @@
+2025-01-18 Regina Obe <lr at pcorp.us>
+
+ * NEWS: Prep for 3.5.2
+
+2025-01-17 Regina Obe <lr at pcorp.us>
+
+ * NEWS, Version.config, doc/release_notes.xml: Prep for PostGIS
+ 3.5.2 release
+
+2025-01-13 Regina Obe <lr at pcorp.us>
+
+ * .woodpecker/docs.yml, .woodpecker/regress.yml: Woodie changes - set doc to use repo.osgeo.org instead of docker.osgeo.org - Change regress testings from PG15 to PG17
+
+2025-01-13 Regina Obe <lr at pcorp.us>
+
+ * NEWS: NEWS update, References #5564 for PostGIS 3.5.2
+
+2025-01-13 Regina Obe <lr at pcorp.us>
+
+ * postgis/brin_2d.c, postgis/brin_nd.c,
+ postgis/geography_brin.sql.in, postgis/postgis_after_upgrade.sql,
+ postgis/postgis_brin.sql.in, regress/core/regress_brin_index.sql,
+ regress/core/regress_brin_index_3d.sql,
+ regress/core/regress_brin_index_geography.sql: BRIN Merge Support - Add merge AM support function (11) for all BRIN operator class families. Supports parallel BRIN build on PG17+ and in general should fix some longstanding low-probability
+ crash cases related to BRIN. - Add upgrade logic to shimmy in the brin_inclusion_merge functions - Add crash tests References #5564 for PostGIS 3.5.2
+
+2025-01-07 Regina Obe <lr at pcorp.us>
+
+ * NEWS, sfcgal/Makefile.in, sfcgal/postgis_sfcgal_legacy.c:
+ pg_upgrade postgis_sfcgal failing because of missing
+ ST_ConstrainDelaunayTriangles signature Closes #5833 for PostGIS 3.5.2
+
+2025-01-07 Paul Ramsey <pramsey at cleverelephant.ca>
+
+ * NEWS, postgis/lwgeom_geos.c: Retain SRID during unary union,
+ references #5677
+
+2024-12-22 Regina Obe <lr at pcorp.us>
+
+ * NEWS, Version.config, extensions/upgradeable_versions.mk: Prep for
+ next 3.5 dev cycle
+
2024-12-22 Regina Obe <lr at pcorp.us>
* doc/release_notes.xml: Fix link tag, was using old ulink, instead
@@ -59,46 +101,5 @@
2024-11-19 Paul Ramsey <pramsey at cleverelephant.ca>
- * NEWS: Add news entry for #5677
-
-2024-11-07 Sandro Santilli <strk at kbt.io>
-
- * liblwgeom/topo/lwgeom_topo.c: Fix small leak of GEOSGeometry References #5808 comment:10
-
-2024-11-07 Sandro Santilli <strk at kbt.io>
-
- * liblwgeom/topo/lwgeom_topo.c: Simplify releasing of GEOS memory References #5808
-
-2024-11-02 Sandro Santilli <strk at kbt.io>
-
- * NEWS, liblwgeom/topo/lwgeom_topo.c,
- topology/test/regress/topogeo_addpoint_merge_edges.sql,
- topology/test/regress/topogeo_addpoint_merge_edges_expected: Check
- motion range upon snap/splitting edge to existing node This time make the polygon valid before using Covers on it Closes #5792 in 3.5 branch (3.5.1dev) References #5786
-
-2024-11-02 Sandro Santilli <strk at kbt.io>
-
- * NEWS, liblwgeom/topo/lwgeom_topo.c,
- topology/test/regress/topogeo_addpoint_merge_edges.sql,
- topology/test/regress/topogeo_addpoint_merge_edges_expected: Revert
- "Check motion range upon snap/splitting edge to existing node" The check is bogus, we need a different approach This reverts commit 69abb0721c7f4e551f0061de9293db61b83a0037. This
- reverts commit 158efb88c1ecc59c3dc195eed6a68bfe87fd9aaf. Re-opens #5792 in 3.5 branch (3.5.1dev) References #5786
-
-2024-09-24 Nikolai B <nikolai-b at users.noreply.github.com>
-
- * doc/reference_guc.xml: - doc: unify gdal_enabled_drivers and enable_outdb_rasters - RO: add PostgreSQL manual links Closes https://github.com/postgis/postgis/pull/779
-
-2024-10-29 Sandro Santilli <strk at kbt.io>
-
- * liblwgeom/topo/lwgeom_topo.c: Fix build (typo, sorry)
-
-2024-10-14 Björn Harrtell <bjorn at septima.dk>
-
- * NEWS, liblwgeom/topo/lwgeom_topo.c: Short circuit contains check
- with shellbox check Optimizes _lwt_AddFaceSplit contains test by using bbox See https://github.com/postgis/postgis/pull/781
-
-2024-10-09 Sandro Santilli <strk at kbt.io>
-
- * Check motion range upon snap/splitting edge to existing node Fixes #5792 in 3.5 branch (3.5.1dev) References #5786 (not resolving
- the problem) Includes regress test
+ * Add news entry for #5677
=====================================
NEWS
=====================================
@@ -1,3 +1,17 @@
+PostGIS 3.5.2
+2025/01/18
+
+To take advantage of all postgis_sfcgal extension features SFCGAL 1.5+ is needed.
+PostgreSQL 12-17 required. GEOS 3.8+ required. Proj 6.1+ required.
+
+* Bug fixes *
+
+- #5677, Retain SRID during unary union (Paul Ramsey)
+- #5833, pg_upgrade fix for postgis_sfcgal (Regina Obe)
+- #5564, BRIN crash fix and support for parallel in PG17+
+ (Paul Ramsey, Regina Obe)
+
+
PostGIS 3.5.1
2024/12/22
@@ -6,7 +20,6 @@ PostgreSQL 12-17 required. GEOS 3.8+ required. Proj 6.1+ required.
* Bug fixes *
-- #5677, Retain SRID during unary union (Paul Ramsey)
- #5792, [topology] Prevent topology corruption with TopoGeo_addPoint near almost
collinear edges (Sandro Santilli)
- #5795, [topology] Fix ST_NewEdgesSplit can cause invalid topology
=====================================
Version.config
=====================================
@@ -5,7 +5,7 @@
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_VERSION=5
-POSTGIS_MICRO_VERSION=1
+POSTGIS_MICRO_VERSION=2
# Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev)
# when changing POSTGIS_MINOR_VERSION
=====================================
doc/release_notes.xml
=====================================
@@ -2,47 +2,61 @@
<appendix xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="release_notes">
<title>Appendix</title>
<subtitle>Release Notes</subtitle>
+ <section>
+ <title>PostGIS 3.5.2</title>
+ <para>2025/01/18</para>
+ <para>This version requires PostgreSQL 12-17, GEOS 3.8 or higher, and Proj 6.1+.
+ To take advantage of all features, GEOS 3.12+ is needed.
+ To take advantage of all SFCGAL features, SFCGAL 1.5.0+ is needed.</para>
+
+ <simplesect>
+ <title>Bug Fixes</title>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5677">#5677</link>, Retain SRID during unary union (Paul Ramsey)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5833">#5833</link>, pg_upgrade fix for postgis_sfcgal (Regina Obe)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5564">#5564</link>, BRIN crash fix and support for parallel in PG17+ (Paul Ramsey, Regina Obe)</para>
+ </simplesect>
+ </section>
<section>
<title>PostGIS 3.5.1</title>
- <para>2024/09/25</para>
+ <para>2024/12/22</para>
<para>This version requires PostgreSQL 12-17, GEOS 3.8 or higher, and Proj 6.1+.
To take advantage of all features, GEOS 3.12+ is needed.
To take advantage of all SFCGAL features, SFCGAL 1.5.0+ is needed.</para>
<simplesect>
<title>Breaking Changes</title>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5677">#5677</link>, Retain SRID during unary union (Paul Ramsey)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5792">#5792</link>, [topology] Prevent topology corruption with TopoGeo_addPoint near almost
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5677">#5677</link>, Retain SRID during unary union (Paul Ramsey)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5792">#5792</link>, [topology] Prevent topology corruption with TopoGeo_addPoint near almost
collinear edges (Sandro Santilli)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5795">#5795</link>, [topology] Fix ST_NewEdgesSplit can cause invalid topology
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5795">#5795</link>, [topology] Fix ST_NewEdgesSplit can cause invalid topology
(Björn Harrtell)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5794">#5794</link>, [topology] Fix crash in TopoGeo_addPoint (Sandro Santilli)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5785">#5785</link>, [raster] ST_MapAlgebra segfaults when expression references
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5794">#5794</link>, [topology] Fix crash in TopoGeo_addPoint (Sandro Santilli)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5785">#5785</link>, [raster] ST_MapAlgebra segfaults when expression references
a supernumerary rast argument (Dian M Fay)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5787">#5787</link>, Check that ST_ChangeEdgeGeom doesn't change winding of rings
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5787">#5787</link>, Check that ST_ChangeEdgeGeom doesn't change winding of rings
(Sandro Santilli)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5791">#5791</link>, Add legacy stubs for old transaction functions
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5791">#5791</link>, Add legacy stubs for old transaction functions
to allow pg_upgrade (Regina Obe)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5800">#5800</link>, PROJ compiled version reading the wrong minor and micro
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5800">#5800</link>, PROJ compiled version reading the wrong minor and micro
(Regina Obe)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5790">#5790</link>, Non-schema qualified calls causing issue with
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5790">#5790</link>, Non-schema qualified calls causing issue with
materialized views (Regina Obe)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5812">#5812</link>, Performance regression in ST_Within (Paul Ramsey)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5815">#5815</link>, Remove hash/merge promise from <> operator (Paul Ramsey)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5823">#5823</link>, Build support for Pg18 (Paul Ramsey)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5812">#5812</link>, Performance regression in ST_Within (Paul Ramsey)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5815">#5815</link>, Remove hash/merge promise from <> operator (Paul Ramsey)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5823">#5823</link>, Build support for Pg18 (Paul Ramsey)</para>
</simplesect>
<simplesect>
<title>Enhancements</title>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5782">#5782</link>, Improve robustness of min distance calculation (Sandro Santilli)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5782">#5782</link>, Improve robustness of min distance calculation (Sandro Santilli)</para>
<para>[topology] Speedup topology building when closing large rings with many
holes (Björn Harrtell)</para>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5810">#5810</link>, Update tiger geocoder to handle TIGER 2024 data (Regina Obe)</para>
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5810">#5810</link>, Update tiger geocoder to handle TIGER 2024 data (Regina Obe)</para>
</simplesect>
<simplesect>
<title>Breaking Changes</title>
- <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/#5799">#5799</link>, make ST_TileEnvelope clip envelopes to tile plane
+ <para><link xlink:href="https://trac.osgeo.org/postgis/ticket/5799">#5799</link>, make ST_TileEnvelope clip envelopes to tile plane
extent (Paul Ramsey)</para>
</simplesect>
</section>
=====================================
extensions/address_standardizer/Makefile
=====================================
@@ -30,7 +30,7 @@ POSTGIS_PGSQL_VERSION=130
# SQL preprocessor
SQLPP = /usr/bin/cpp -traditional-cpp -w -P -Upixel -Ubool
GREP=/bin/grep
-EXTVERSION = 3.5.1
+EXTVERSION = 3.5.2
MODULE_big = address_standardizer-3
MODULEPATH = $$libdir/address_standardizer-3
ifeq (no,yes)
@@ -48,7 +48,7 @@ DATA_built = \
$(NULL)
all: sql/address_standardizer_pre.sql sql/address_standardizer.sql sql/address_standardizer--1.0--$(EXTVERSION).sql sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql \
- sql/$(EXTENSION)_data_us.sql sql/address_standardizer--3.5.1.sql sql/$(EXTENSION)_data_us--3.5.1.sql sql/$(EXTENSION)_data_us--$(EXTVERSION)--$(EXTVERSION)next.sql \
+ sql/$(EXTENSION)_data_us.sql sql/address_standardizer--3.5.2.sql sql/$(EXTENSION)_data_us--3.5.2.sql sql/$(EXTENSION)_data_us--$(EXTVERSION)--$(EXTVERSION)next.sql \
sql/$(EXTENSION)_data_us--$(EXTVERSION)next--$(EXTVERSION).sql sql/$(EXTENSION)_data_us--ANY--$(EXTVERSION).sql \
sql/test-init-extensions.sql sql/test-parseaddress.sql sql/test-standardize_address_1.sql sql/test-standardize_address_2.sql sql/test-debug_standardize_address.sql
=====================================
extensions/upgradeable_versions.mk
=====================================
@@ -109,4 +109,5 @@ UPGRADEABLE_VERSIONS = \
3.4.2 \
3.4.3 \
3.4.4 \
- 3.5.0
+ 3.5.0 \
+ 3.5.1
=====================================
postgis/brin_2d.c
=====================================
@@ -89,3 +89,30 @@ geom2d_brin_inclusion_add_value(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(true);
}
+
+
+PG_FUNCTION_INFO_V1(geom2d_brin_inclusion_merge);
+Datum
+geom2d_brin_inclusion_merge(PG_FUNCTION_ARGS)
+{
+ BOX2DF *box_key = (BOX2DF *) PG_GETARG_POINTER(0);
+ BOX2DF *box_geom = (BOX2DF *) PG_GETARG_POINTER(1);
+
+ /*
+ * Check if the stored bounding box already contains the geometry's one.
+ *
+ * If not, enlarge the stored box2df to make it contains the current
+ * geometry.
+ */
+ if (!box2df_contains(box_key, box_geom))
+ {
+ box_key->xmin = Min(box_key->xmin, box_geom->xmin);
+ box_key->xmax = Max(box_key->xmax, box_geom->xmax);
+ box_key->ymin = Min(box_key->ymin, box_geom->ymin);
+ box_key->ymax = Max(box_key->ymax, box_geom->ymax);
+ }
+
+ PG_RETURN_POINTER(box_key);
+}
+
+
=====================================
postgis/brin_nd.c
=====================================
@@ -11,8 +11,12 @@
* FunctionCallInvoke machinery for each heap tuple.
*/
-Datum gidx_brin_inclusion_add_value(BrinDesc *bdesc, BrinValues *column, Datum
- newval, bool isnull, int max_dims);
+static Datum gidx_brin_inclusion_add_value(
+ BrinDesc *bdesc, BrinValues *column,
+ Datum newval, bool isnull, int max_dims);
+
+static GIDX * gidx_brin_inclusion_merge(
+ GIDX *gidx_key, GIDX *gidx_geom);
/*
* As for the GiST case, geographies are converted into GIDX before
@@ -58,7 +62,7 @@ geom4d_brin_inclusion_add_value(PG_FUNCTION_ARGS)
4));
}
-Datum
+static Datum
gidx_brin_inclusion_add_value(__attribute__((__unused__)) BrinDesc *bdesc,
BrinValues *column, Datum newval, bool isnull, int max_dims)
{
@@ -186,3 +190,52 @@ gidx_brin_inclusion_add_value(__attribute__((__unused__)) BrinDesc *bdesc,
PG_RETURN_BOOL(true);
}
+
+
+static GIDX *
+gidx_brin_inclusion_merge(GIDX *gidx_key, GIDX *gidx_geom)
+{
+ if (!gidx_contains(gidx_key, gidx_geom))
+ {
+ for (uint32_t i = 0; i < GIDX_NDIMS(gidx_key); i++)
+ {
+ /* Adjust minimums */
+ GIDX_SET_MIN(gidx_key, i,
+ Min(GIDX_GET_MIN(gidx_key,i),GIDX_GET_MIN(gidx_geom,i)));
+ /* Adjust maximums */
+ GIDX_SET_MAX(gidx_key, i,
+ Max(GIDX_GET_MAX(gidx_key,i),GIDX_GET_MAX(gidx_geom,i)));
+ }
+ }
+
+ return gidx_key;
+}
+
+PG_FUNCTION_INFO_V1(geog_brin_inclusion_merge);
+Datum geog_brin_inclusion_merge(PG_FUNCTION_ARGS)
+{
+ GIDX *key = (GIDX *) PG_GETARG_POINTER(0);
+ GIDX *geom = (GIDX *) PG_GETARG_POINTER(1);
+
+ PG_RETURN_POINTER(gidx_brin_inclusion_merge(key, geom));
+}
+
+PG_FUNCTION_INFO_V1(geom3d_brin_inclusion_merge);
+Datum geom3d_brin_inclusion_merge(PG_FUNCTION_ARGS)
+{
+ GIDX *key = (GIDX *) PG_GETARG_POINTER(0);
+ GIDX *geom = (GIDX *) PG_GETARG_POINTER(1);
+
+ PG_RETURN_POINTER(gidx_brin_inclusion_merge(key, geom));
+}
+
+PG_FUNCTION_INFO_V1(geom4d_brin_inclusion_merge);
+Datum geom4d_brin_inclusion_merge(PG_FUNCTION_ARGS)
+{
+ GIDX *key = (GIDX *) PG_GETARG_POINTER(0);
+ GIDX *geom = (GIDX *) PG_GETARG_POINTER(1);
+
+ PG_RETURN_POINTER(gidx_brin_inclusion_merge(key, geom));
+}
+
+
=====================================
postgis/geography_brin.sql.in
=====================================
@@ -54,9 +54,16 @@ CREATE OPERATOR && (
--------------------------------
-- Availability: 2.3.0
-CREATE OR REPLACE FUNCTION geog_brin_inclusion_add_value(internal, internal, internal, internal) RETURNS boolean
+CREATE OR REPLACE FUNCTION geog_brin_inclusion_add_value(internal, internal, internal, internal)
+RETURNS boolean
AS 'MODULE_PATHNAME','geog_brin_inclusion_add_value'
- LANGUAGE 'c';
+ LANGUAGE 'c' PARALLEL SAFE;
+
+-- Availability: 3.6.0
+CREATE OR REPLACE FUNCTION geog_brin_inclusion_merge(internal, internal)
+RETURNS internal
+ AS 'MODULE_PATHNAME','geog_brin_inclusion_merge'
+ LANGUAGE 'c' PARALLEL SAFE;
-- Availability: 2.3.0
CREATE OPERATOR CLASS brin_geography_inclusion_ops
@@ -66,6 +73,7 @@ CREATE OPERATOR CLASS brin_geography_inclusion_ops
FUNCTION 2 geog_brin_inclusion_add_value(internal, internal, internal, internal),
FUNCTION 3 brin_inclusion_consistent(internal, internal, internal),
FUNCTION 4 brin_inclusion_union(internal, internal, internal),
+ FUNCTION 11 geog_brin_inclusion_merge(internal, internal),
OPERATOR 3 &&(geography, geography),
OPERATOR 3 &&(geography, gidx),
OPERATOR 3 &&(gidx, geography),
=====================================
postgis/lwgeom_geos.c
=====================================
@@ -584,6 +584,7 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic pop
#endif
+ srid = GEOSGetSRID(g);
g_union = GEOSUnaryUnion(g);
GEOSGeom_destroy(g);
if (!g_union) HANDLE_GEOS_ERROR("GEOSUnaryUnion");
=====================================
postgis/postgis_after_upgrade.sql
=====================================
@@ -276,3 +276,232 @@ IF _postgis_scripts_pgsql_version()::integer >= 96 THEN
END IF;
END;
$$;
+
+-- #5564 fix up the brin op classes for upgrades
+DO language plpgsql
+$$
+BEGIN
+ -- Check if the function is already associated with any operator class
+ IF NOT EXISTS (
+ SELECT 1 FROM pg_catalog.pg_amproc
+ WHERE amproc::text = 'geom2d_brin_inclusion_merge' AND
+ amprocfamily IN (
+ SELECT oid FROM pg_catalog.pg_opfamily
+ WHERE opfname = 'brin_geometry_inclusion_ops_2d'
+ )
+ ) THEN
+ BEGIN
+ -- Create a temporary operator class for 'brin_geometry_inclusion_ops_2d_temp'
+ CREATE OPERATOR CLASS brin_geometry_inclusion_ops_2d_temp
+ FOR TYPE geometry USING brin AS
+ FUNCTION 11 geom2d_brin_inclusion_merge(internal, internal);
+
+ -- find current and new operator family OIDs
+ WITH a AS (
+ SELECT n.oid AS oid_nfamily, o.oid AS oid_ofamily
+ FROM pg_catalog.pg_opfamily AS n
+ CROSS JOIN (
+ SELECT oid
+ FROM pg_catalog.pg_opfamily
+ WHERE opfname = 'brin_geometry_inclusion_ops_2d_temp'
+ ) AS o
+ WHERE n.opfname = 'brin_geometry_inclusion_ops_2d'
+ ),
+ -- Update the amprocfamily in pg_amproc
+ amupdate AS (
+ UPDATE pg_catalog.pg_amproc AS amp
+ SET amprocfamily = a.oid_nfamily
+ FROM a
+ WHERE amp.amprocfamily = a.oid_ofamily AND
+ amp.amproc::text = 'geom2d_brin_inclusion_merge'
+ RETURNING amp.*
+ )
+ -- Update dependencies in pg_depend to the existing operator class
+ UPDATE pg_depend AS d
+ SET refobjid = (
+ SELECT n.oid
+ FROM pg_catalog.pg_opclass AS n
+ WHERE opcname = 'brin_geometry_inclusion_ops_2d'
+ )
+ FROM amupdate
+ WHERE d.objid = amupdate.oid AND
+ refobjid = (
+ SELECT o.oid
+ FROM pg_catalog.pg_opclass AS o
+ WHERE opcname = 'brin_geometry_inclusion_ops_2d_temp'
+ );
+
+ -- Drop the temporary operator family after use
+ DROP OPERATOR FAMILY brin_geometry_inclusion_ops_2d_temp USING brin;
+ EXCEPTION WHEN OTHERS THEN
+ RAISE EXCEPTION
+ 'Could not add geom2d_brin_inclusion_merge to brin_geometry_inclusion_ops_2d class: %',
+ SQLERRM;
+ END;
+ END IF;
+
+ -- Check if the function is already associated with any operator class
+ IF NOT EXISTS (
+ SELECT 1
+ FROM pg_catalog.pg_amproc
+ WHERE amproc::text = 'geom3d_brin_inclusion_merge'
+ ) THEN
+ BEGIN
+ -- Create a temporary operator class with the new function
+ CREATE OPERATOR CLASS brin_geometry_inclusion_ops_3d_temp
+ FOR TYPE geometry USING brin AS
+ FUNCTION 11 geom3d_brin_inclusion_merge(internal, internal);
+
+ -- Change the pg_amproc association to the existing opclass
+ WITH a AS (
+ SELECT n.oid AS oid_nfamily, o.oid AS oid_ofamily
+ FROM pg_catalog.pg_opfamily AS n
+ CROSS JOIN (
+ SELECT oid FROM pg_catalog.pg_opfamily
+ WHERE opfname = 'brin_geometry_inclusion_ops_3d_temp'
+ ) AS o
+ WHERE n.opfname = 'brin_geometry_inclusion_ops_3d'
+ ), amupdate AS (
+ UPDATE pg_catalog.pg_amproc AS amp
+ SET amprocfamily = a.oid_nfamily
+ FROM a
+ WHERE
+ amp.amprocfamily = a.oid_ofamily
+ AND amp.amproc::text = 'geom3d_brin_inclusion_merge'
+ RETURNING amp.*
+ )
+ -- Change the opclass dependency to the existing one
+ UPDATE pg_depend AS d
+ SET refobjid = (
+ SELECT n.oid
+ FROM pg_catalog.pg_opclass AS n
+ WHERE opcname = 'brin_geometry_inclusion_ops_3d'
+ )
+ FROM amupdate
+ WHERE d.objid = amupdate.oid AND
+ refobjid = (
+ SELECT o.oid
+ FROM pg_catalog.pg_opclass AS o
+ WHERE opcname = 'brin_geometry_inclusion_ops_3d_temp'
+ );
+
+ -- Dropping the autogenerated temporary family which cascades to temporary class
+ DROP OPERATOR FAMILY brin_geometry_inclusion_ops_3d_temp USING brin;
+ EXCEPTION WHEN OTHERS THEN
+ RAISE EXCEPTION 'Could not add geom3d_brin_inclusion_merge to brin_geometry_inclusion_ops_3d class: %', SQLERRM;
+ END;
+ END IF;
+
+ -- Check if the function is already associated with any operator class
+ IF NOT EXISTS (
+ SELECT 1
+ FROM pg_catalog.pg_amproc
+ WHERE amproc::text = 'geom4d_brin_inclusion_merge'
+ ) THEN
+ BEGIN
+ -- Create a temporary operator class with the new function
+ CREATE OPERATOR CLASS brin_geometry_inclusion_ops_4d_temp
+ FOR TYPE geometry USING brin AS
+ FUNCTION 11 geom4d_brin_inclusion_merge(internal, internal);
+
+ -- Change the pg_amproc association to the existing opclass
+ WITH a AS (
+ SELECT n.oid AS oid_nfamily, o.oid AS oid_ofamily
+ FROM pg_catalog.pg_opfamily AS n
+ CROSS JOIN (
+ SELECT oid FROM pg_catalog.pg_opfamily
+ WHERE opfname = 'brin_geometry_inclusion_ops_4d_temp'
+ ) AS o
+ WHERE n.opfname = 'brin_geometry_inclusion_ops_4d'
+ ) , amupdate AS (
+ UPDATE pg_catalog.pg_amproc AS amp
+ SET amprocfamily = a.oid_nfamily
+ FROM a
+ WHERE
+ amp.amprocfamily = a.oid_ofamily
+ AND amp.amproc::text = 'geom4d_brin_inclusion_merge'
+ RETURNING amp.*
+ )
+ -- Change the opclass dependency to the existing one
+ UPDATE pg_depend AS d
+ SET refobjid = (
+ SELECT n.oid
+ FROM pg_catalog.pg_opclass AS n
+ WHERE opcname = 'brin_geometry_inclusion_ops_4d'
+ )
+ FROM amupdate
+ WHERE d.objid = amupdate.oid AND
+ refobjid = (
+ SELECT o.oid
+ FROM pg_catalog.pg_opclass AS o
+ WHERE opcname = 'brin_geometry_inclusion_ops_4d_temp'
+ );
+
+ -- Dropping the autogenerated temporary family also drops the temporary class
+ DROP OPERATOR FAMILY brin_geometry_inclusion_ops_4d_temp USING brin;
+ EXCEPTION WHEN OTHERS THEN
+ RAISE EXCEPTION
+ 'Could not add geom4d_brin_inclusion_merge to brin_geometry_inclusion_ops_4d class: %',
+ SQLERRM;
+ END;
+ END IF;
+
+-- geography brin
+ -- Check if the function 'geog_brin_inclusion_merge' already exists
+ IF NOT EXISTS (
+ SELECT 1
+ FROM pg_catalog.pg_amproc
+ WHERE amproc::text = 'geog_brin_inclusion_merge'
+ ) THEN
+ BEGIN
+ -- Create a temporary operator class for 'brin_geography_inclusion_ops_temp'
+ CREATE OPERATOR CLASS brin_geography_inclusion_ops_temp
+ FOR TYPE geography USING brin AS
+ FUNCTION 11 geog_brin_inclusion_merge(internal, internal);
+
+ -- find current and new operator family OIDs
+ WITH a AS (
+ SELECT n.oid AS oid_nfamily, o.oid AS oid_ofamily
+ FROM pg_catalog.pg_opfamily AS n
+ CROSS JOIN (
+ SELECT oid
+ FROM pg_catalog.pg_opfamily
+ WHERE opfname = 'brin_geography_inclusion_ops_temp'
+ ) AS o
+ WHERE n.opfname = 'brin_geography_inclusion_ops'
+ ),
+ -- Update the amprocfamily in pg_amproc
+ amupdate AS (
+ UPDATE pg_catalog.pg_amproc AS amp
+ SET amprocfamily = a.oid_nfamily
+ FROM a
+ WHERE amp.amprocfamily = a.oid_ofamily AND
+ amp.amproc::text = 'geog_brin_inclusion_merge'
+ RETURNING amp.*
+ )
+ -- Update dependencies in pg_depend to the existing operator class
+ UPDATE pg_depend AS d
+ SET refobjid = (
+ SELECT n.oid
+ FROM pg_catalog.pg_opclass AS n
+ WHERE opcname = 'brin_geography_inclusion_ops'
+ )
+ FROM amupdate
+ WHERE d.objid = amupdate.oid AND
+ refobjid = (
+ SELECT o.oid
+ FROM pg_catalog.pg_opclass AS o
+ WHERE opcname = 'brin_geography_inclusion_ops_temp'
+ );
+
+ -- Drop the temporary operator family after use
+ DROP OPERATOR FAMILY brin_geography_inclusion_ops_temp USING brin;
+ EXCEPTION WHEN OTHERS THEN
+ RAISE EXCEPTION
+ 'Could not add geog_brin_inclusion_merge to brin_geography_inclusion_ops class: %',
+ SQLERRM;
+ END;
+ END IF;
+END;
+
+$$;
=====================================
postgis/postgis_brin.sql.in
=====================================
@@ -192,18 +192,36 @@ RETURNS boolean
AS 'MODULE_PATHNAME','geom2d_brin_inclusion_add_value'
LANGUAGE 'c' PARALLEL SAFE _COST_DEFAULT;
+-- Availability: 3.6.0
+CREATE OR REPLACE FUNCTION geom2d_brin_inclusion_merge(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME','geom2d_brin_inclusion_merge'
+LANGUAGE 'c' PARALLEL SAFE _COST_DEFAULT;
+
-- Availability: 2.3.0
CREATE OR REPLACE FUNCTION geom3d_brin_inclusion_add_value(internal, internal, internal, internal)
RETURNS boolean
AS 'MODULE_PATHNAME','geom3d_brin_inclusion_add_value'
LANGUAGE 'c' PARALLEL SAFE _COST_DEFAULT;
+-- Availability: 3.6.0
+CREATE OR REPLACE FUNCTION geom3d_brin_inclusion_merge(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME','geom3d_brin_inclusion_merge'
+LANGUAGE 'c' PARALLEL SAFE _COST_DEFAULT;
+
-- Availability: 2.3.0
CREATE OR REPLACE FUNCTION geom4d_brin_inclusion_add_value(internal, internal, internal, internal)
RETURNS boolean
AS 'MODULE_PATHNAME','geom4d_brin_inclusion_add_value'
LANGUAGE 'c' PARALLEL SAFE _COST_DEFAULT;
+-- Availability: 3.6.0
+CREATE OR REPLACE FUNCTION geom4d_brin_inclusion_merge(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME','geom4d_brin_inclusion_merge'
+LANGUAGE 'c' PARALLEL SAFE _COST_DEFAULT;
+
-- Availability: 2.3.0
CREATE OPERATOR CLASS brin_geometry_inclusion_ops_2d
DEFAULT FOR TYPE geometry
@@ -212,6 +230,7 @@ CREATE OPERATOR CLASS brin_geometry_inclusion_ops_2d
FUNCTION 2 geom2d_brin_inclusion_add_value(internal, internal, internal, internal),
FUNCTION 3 brin_inclusion_consistent(internal, internal, internal),
FUNCTION 4 brin_inclusion_union(internal, internal, internal),
+ FUNCTION 11 geom2d_brin_inclusion_merge(internal, internal),
OPERATOR 3 &&(box2df, box2df),
OPERATOR 3 &&(box2df, geometry),
OPERATOR 3 &&(geometry, box2df),
@@ -226,6 +245,7 @@ CREATE OPERATOR CLASS brin_geometry_inclusion_ops_2d
OPERATOR 8 @(geometry, geometry),
STORAGE box2df;
+
-------------
-- 3D case --
-------------
@@ -238,6 +258,7 @@ CREATE OPERATOR CLASS brin_geometry_inclusion_ops_3d
FUNCTION 2 geom3d_brin_inclusion_add_value(internal, internal, internal, internal),
FUNCTION 3 brin_inclusion_consistent(internal, internal, internal),
FUNCTION 4 brin_inclusion_union(internal, internal, internal),
+ FUNCTION 11 geom3d_brin_inclusion_merge(internal, internal),
OPERATOR 3 &&&(geometry, geometry),
OPERATOR 3 &&&(geometry, gidx),
OPERATOR 3 &&&(gidx, geometry),
@@ -256,6 +277,7 @@ CREATE OPERATOR CLASS brin_geometry_inclusion_ops_4d
FUNCTION 2 geom4d_brin_inclusion_add_value(internal, internal, internal, internal),
FUNCTION 3 brin_inclusion_consistent(internal, internal, internal),
FUNCTION 4 brin_inclusion_union(internal, internal, internal),
+ FUNCTION 11 geom4d_brin_inclusion_merge(internal, internal),
OPERATOR 3 &&&(geometry, geometry),
OPERATOR 3 &&&(geometry, gidx),
OPERATOR 3 &&&(gidx, geometry),
=====================================
postgis_revision.h
=====================================
@@ -1 +1 @@
-#define POSTGIS_REVISION 48ab069
+#define POSTGIS_REVISION dea6d0a
=====================================
regress/core/regress_brin_index.sql
=====================================
@@ -171,8 +171,15 @@ SELECT 'scan_idx', qnodes('select count(*) from test where the_geom &&& ''BOX3D(
DROP INDEX brin_4d;
+-- #5564
+SET max_parallel_workers TO 2;
+CREATE TABLE random_points AS
+SELECT ST_MakePoint(0, 0) AS geom FROM generate_series(1, 130562);
+CREATE INDEX ON random_points USING brin(geom);
+
-- cleanup
DROP TABLE test;
+DROP TABLE random_points;
DROP FUNCTION qnodes(text);
set enable_indexscan = on;
=====================================
regress/core/regress_brin_index_3d.sql
=====================================
@@ -246,8 +246,15 @@ SELECT 'scan_idx', qnodes('select * from test where the_geom && ''BOX(1 1, 5 5)'
DROP INDEX brin_4d;
+-- #5564
+SET max_parallel_workers TO 2;
+CREATE TABLE random_points AS
+SELECT ST_MakePoint(0, 0, 0) AS geom FROM generate_series(1, 130562);
+CREATE INDEX ON random_points USING brin(geom);
+
-- cleanup
DROP TABLE test;
+DROP TABLE random_points;
DROP FUNCTION qnodes(text);
set enable_indexscan = on;
=====================================
regress/core/regress_brin_index_geography.sql
=====================================
@@ -55,8 +55,15 @@ SELECT '#4608-2', count(*) FROM test where ST_CoveredBy(the_geog, ST_GeogFromTex
DROP INDEX brin_geog;
+-- #5564
+SET max_parallel_workers TO 2;
+CREATE TABLE random_points AS
+SELECT ST_MakePoint(0, 0)::geography AS geog FROM generate_series(1, 130562);
+CREATE INDEX ON random_points USING brin(geog);
+
-- cleanup
DROP TABLE test;
+DROP TABLE random_points;
DROP FUNCTION qnodes(text);
set enable_indexscan = on;
=====================================
sfcgal/Makefile.in
=====================================
@@ -46,7 +46,7 @@ SQL_OBJS = \
# Objects to build using PGXS
-OBJS = lwgeom_sfcgal.o
+OBJS = lwgeom_sfcgal.o postgis_sfcgal_legacy.o
# Libraries to link into the module (proj, geos)
#
=====================================
sfcgal/postgis_sfcgal_legacy.c
=====================================
@@ -0,0 +1,55 @@
+/**********************************************************************
+ *
+ * PostGIS - Spatial Types for PostgreSQL
+ * http://postgis.net
+ *
+ * PostGIS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PostGIS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
+ *
+ **********************************************************************
+ *
+ * Copyright (C) 2025 Regina Obe <lr at pcorp.us>
+ *
+ **********************************************************************/
+/******************************************************************************
+ * This file is to hold functions we no longer use,
+ * but we need to keep because they were used at one time behind SQL API functions.
+ * This is to ease pg_upgrade upgrades
+ *
+ * All functions in this file should throw an error telling the user to upgrade
+ * the install
+ *
+ *****************************************************************************/
+
+#include "postgres.h"
+#include "utils/builtins.h"
+#include "../postgis_config.h"
+#include "lwgeom_pg.h"
+
+#define POSTGIS_DEPRECATE(version, funcname) \
+ Datum funcname(PG_FUNCTION_ARGS); \
+ PG_FUNCTION_INFO_V1(funcname); \
+ Datum funcname(PG_FUNCTION_ARGS) \
+ { \
+ ereport(ERROR, (\
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
+ errmsg("A stored procedure tried to use deprecated C function '%s'", \
+ __func__), \
+ errdetail("Library function '%s' was deprecated in PostGIS %s", \
+ __func__, version), \
+ errhint("Consider running: SELECT postgis_extensions_upgrade()") \
+ )); \
+ PG_RETURN_POINTER(NULL); \
+ }
+
+POSTGIS_DEPRECATE("3.4.0", ST_ConstrainedDelaunayTriangles)
\ No newline at end of file
View it on GitLab: https://salsa.debian.org/debian-gis-team/postgis/-/commit/5e4266056a9563a4d2076bdc73d5eab9ab3395f8
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/postgis/-/commit/5e4266056a9563a4d2076bdc73d5eab9ab3395f8
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250119/7e306104/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list