[SCM] PostGIS branch stable-3.5 updated. 3.5.1-6-ge07da2483
git at osgeo.org
git at osgeo.org
Mon Jan 13 14:13:54 PST 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.5 has been updated
via e07da2483f7933701ec7efd17c0515b5b51066a8 (commit)
via f88f26e1f8f2e5bee4efe06b0bf89d9604f5eeaf (commit)
via 5a03c5e1f6e4424f59483cd819beaed905b941f1 (commit)
from 395ec2242b3187f786ea84f1f267a6a4ebc6ba81 (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 e07da2483f7933701ec7efd17c0515b5b51066a8
Author: Regina Obe <lr at pcorp.us>
Date: Mon Jan 13 10:43:11 2025 -0500
Woodie changes
- set doc to use repo.osgeo.org instead of docker.osgeo.org
- Change regress testings from PG15 to PG17
diff --git a/.woodpecker/docs.yml b/.woodpecker/docs.yml
index 31d75a690..3ff829d4b 100644
--- a/.woodpecker/docs.yml
+++ b/.woodpecker/docs.yml
@@ -1,5 +1,5 @@
variables:
- - &test_image 'docker.osgeo.org/postgis/build-test:trisquel11'
+ - &test_image 'repo.osgeo.org/postgis/build-test:trisquel11'
- common_doc_paths: &common_doc_paths
# related config files
- ".woodpecker/docs.yml"
diff --git a/.woodpecker/regress.yml b/.woodpecker/regress.yml
index c6340d116..cb4478917 100644
--- a/.woodpecker/regress.yml
+++ b/.woodpecker/regress.yml
@@ -66,11 +66,11 @@ steps:
- <<: *steps-env
- <<: *steps-pg-build
- build-pg15:
+ build-pg17:
image: *test-image
depends_on: autogen
environment:
- - PGVER=15
+ - PGVER=17
commands:
- <<: *steps-env
- <<: *steps-pg-build
@@ -85,11 +85,11 @@ steps:
- <<: *steps-start-postgresql
- <<: *steps-pg-test-preinstall
- check-pg15:
+ check-pg17:
image: *test-image
- depends_on: build-pg15
+ depends_on: build-pg17
environment:
- - PGVER=15
+ - PGVER=17
commands:
- <<: *steps-env
- <<: *steps-start-postgresql
@@ -106,11 +106,11 @@ steps:
- <<: *steps-pg-install
- <<: *steps-pg-test-install
- installcheck-pg15:
+ installcheck-pg17:
image: *test-image
- depends_on: build-pg15
+ depends_on: build-pg17
environment:
- - PGVER=15
+ - PGVER=17
commands:
- <<: *steps-env
- <<: *steps-start-postgresql
@@ -128,11 +128,11 @@ steps:
- <<: *steps-pg-install
- <<: *steps-pg-test-all-upgrades
- upgradecheck-pg15:
+ upgradecheck-pg17:
image: *test-image
- depends_on: installcheck-pg15
+ depends_on: installcheck-pg17
environment:
- - PGVER=15
+ - PGVER=17
commands:
- <<: *steps-env
- <<: *steps-start-postgresql
commit f88f26e1f8f2e5bee4efe06b0bf89d9604f5eeaf
Author: Regina Obe <lr at pcorp.us>
Date: Mon Jan 13 10:40:40 2025 -0500
NEWS update, References #5564 for PostGIS 3.5.2
diff --git a/NEWS b/NEWS
index 2836a7608..eccdd92c9 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PostgreSQL 12-17 required. GEOS 3.8+ required. Proj 6.1+ required.
- #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
commit 5a03c5e1f6e4424f59483cd819beaed905b941f1
Author: Regina Obe <lr at pcorp.us>
Date: Mon Jan 13 10:34:47 2025 -0500
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
diff --git a/postgis/brin_2d.c b/postgis/brin_2d.c
index 6b584fdc5..1399fc097 100644
--- a/postgis/brin_2d.c
+++ b/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);
+}
+
+
diff --git a/postgis/brin_nd.c b/postgis/brin_nd.c
index 1e0c93368..246be78de 100644
--- a/postgis/brin_nd.c
+++ b/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));
+}
+
+
diff --git a/postgis/geography_brin.sql.in b/postgis/geography_brin.sql.in
index 928a85547..694e0aa92 100644
--- a/postgis/geography_brin.sql.in
+++ b/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),
diff --git a/postgis/postgis_after_upgrade.sql b/postgis/postgis_after_upgrade.sql
index 327e6a05a..2d1cab727 100644
--- a/postgis/postgis_after_upgrade.sql
+++ b/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;
+
+$$;
diff --git a/postgis/postgis_brin.sql.in b/postgis/postgis_brin.sql.in
index 340dd1f8d..9009a7420 100644
--- a/postgis/postgis_brin.sql.in
+++ b/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),
diff --git a/regress/core/regress_brin_index.sql b/regress/core/regress_brin_index.sql
index 30f04280e..6e952c3c9 100644
--- a/regress/core/regress_brin_index.sql
+++ b/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;
diff --git a/regress/core/regress_brin_index_3d.sql b/regress/core/regress_brin_index_3d.sql
index 60753615b..ccfc87403 100644
--- a/regress/core/regress_brin_index_3d.sql
+++ b/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;
diff --git a/regress/core/regress_brin_index_geography.sql b/regress/core/regress_brin_index_geography.sql
index 697547cea..6ba5e1f41 100644
--- a/regress/core/regress_brin_index_geography.sql
+++ b/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;
-----------------------------------------------------------------------
Summary of changes:
.woodpecker/docs.yml | 2 +-
.woodpecker/regress.yml | 22 +--
NEWS | 2 +
postgis/brin_2d.c | 27 +++
postgis/brin_nd.c | 59 ++++++-
postgis/geography_brin.sql.in | 12 +-
postgis/postgis_after_upgrade.sql | 229 ++++++++++++++++++++++++++
postgis/postgis_brin.sql.in | 22 +++
regress/core/regress_brin_index.sql | 7 +
regress/core/regress_brin_index_3d.sql | 7 +
regress/core/regress_brin_index_geography.sql | 7 +
11 files changed, 379 insertions(+), 17 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list