[SCM] PostGIS branch stable-3.4 updated. 3.4.4-47-gc95f296c1
git at osgeo.org
git at osgeo.org
Fri Sep 5 15:58:10 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.4 has been updated
via c95f296c192419ce8e1a806054bd97a0ebd7fcf2 (commit)
from 304ba2def6aca0067796b6930fd8d7ef0589463a (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 c95f296c192419ce8e1a806054bd97a0ebd7fcf2
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Fri Sep 5 15:58:04 2025 -0700
#5978, fix parsing of constraints in geometry_columns
diff --git a/NEWS b/NEWS
index 67a6c40b6..950ba4f4b 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Proj 6.1+ required.
* Bug Fixes *
+ - #5978, fix parsing of constraints in geometry_columns (Paul Ramsey)
- #5977, Fix downgrade protection with standard conforming strings off (Sandro Santilli)
- #5947, [topology] Fix crash in ST_ModEdgeHeal (Sandro Santilli)
- #5951, [topology] Fix crash in ST_GetFaceEdges with corrupted topology (Sandro Santilli)
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 5e7f8fd04..2bc1a6bf7 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -6426,28 +6426,28 @@ CREATE OR REPLACE VIEW geometry_columns AS
LEFT JOIN ( SELECT s.connamespace,
s.conrelid,
s.conkey,
- (regexp_match(s.consrc, E'geometrytype\(\w+\)\s*=\s*(\w+)', E'i'))[1]::text AS type
+ (regexp_match(s.consrc, $$geometrytype\(\w+\)\s*=\s*'(\w+)'$$, 'i'))[1]::text AS type
FROM (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
FROM pg_constraint) AS s
- WHERE s.consrc ~* E'geometrytype(\w+)\s*=\s*\w+'::text
+ WHERE s.consrc ~* $$geometrytype\(\w+\)\s*=\s*'\w+'$$::text
) st ON st.connamespace = n.oid AND st.conrelid = c.oid AND (a.attnum = ANY (st.conkey))
LEFT JOIN ( SELECT s.connamespace,
s.conrelid,
s.conkey,
- (regexp_match(s.consrc, E'ndims\(\w+\)\s*=\s*(\d+)', E'i'))[1]::integer AS ndims
+ (regexp_match(s.consrc, $$ndims\(\w+\)\s*=\s*(\d+)$$, 'i'))[1]::integer AS ndims
FROM (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
FROM pg_constraint) AS s
- WHERE s.consrc ~* E'ndims(\w+)\s*=\s*\d+'::text
+ WHERE s.consrc ~* $$ndims\(\w+\)\s*=\s*\d+$$::text
) sn ON sn.connamespace = n.oid AND sn.conrelid = c.oid AND (a.attnum = ANY (sn.conkey))
LEFT JOIN ( SELECT s.connamespace,
s.conrelid,
s.conkey,
- (regexp_match(s.consrc, E'srid\(\w+\)\s*=\s*(\d+)', E'i'))[1]::integer As srid
+ (regexp_match(s.consrc, $$srid\(\w+\)\s*=\s*(\d+)$$, 'i'))[1]::integer As srid
FROM (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
FROM pg_constraint) AS s
- WHERE s.consrc ~* E'srid(\w+)\s*=\s*\d+'::text
+ WHERE s.consrc ~* $$srid\(\w+\)\s*=\s*\d+$$::text
) sr ON sr.connamespace = n.oid AND sr.conrelid = c.oid AND (a.attnum = ANY (sr.conkey))
WHERE (c.relkind = ANY (ARRAY['r'::"char", 'v'::"char", 'm'::"char", 'f'::"char", 'p'::"char"]))
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index a6a0d447e..6e665a940 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1550,3 +1550,22 @@ FROM g, generate_series(1,2);
SELECT '#5876', ST_AsText(ST_AddPoint(
'LINESTRING (1 1, 2 2)'::geometry,
'POINT EMPTY'::geometry), 2);
+
+-- -------------------------------------------------------------------------------------
+-- #5978, geometry_columns not showing right SRID and Type
+-- #5829, SELECT geometry_columns returns unexpected error
+CREATE TABLE test5829 (
+ geom geometry);
+ALTER TABLE test5829
+ ADD CONSTRAINT c1
+ CHECK (ST_SRID(geom)=4326 and ST_IsValid(geom));
+CREATE TABLE public.test5978 (
+ OBJECTID SERIAL NOT NULL,
+ PKEY INTEGER,
+ PRIMARY KEY (OBJECTID));
+SELECT AddGeometryColumn('public', 'test5978', 'shape', 4326, upper('POINT'), 2, false);
+SELECT AddGeometryColumn('public', 'test5978', 'geometry', 4326, upper('POINT'), 2, true);
+SELECT f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, type
+ FROM geometry_columns WHERE f_table_name IN ('test5829', 'test5978')
+ ORDER BY f_table_name, f_geometry_column;
+DROP TABLE IF EXISTS test5829, test5978;
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index af989311b..dc8a7cf95 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -473,3 +473,8 @@ ERROR: Geometry contains invalid coordinates
#5647|intersects_empty false|within_empty false|contains_empty false|coveredby_empty false|covers_empty false|intersects_mixed_empty true|within_mixed_empty false|contains_mixed_empty false|coveredby_mixed_empty true|covers_mixed_empty true
#5647|intersects_empty false|within_empty false|contains_empty false|coveredby_empty false|covers_empty false|intersects_mixed_empty true|within_mixed_empty false|contains_mixed_empty false|coveredby_mixed_empty true|covers_mixed_empty true
#5876|LINESTRING(1 1,2 2)
+public.test5978.shape SRID:4326 TYPE:POINT DIMS:2
+public.test5978.geometry SRID:4326 TYPE:POINT DIMS:2
+public|test5829|geom|2|4326|GEOMETRY
+public|test5978|geometry|2|4326|POINT
+public|test5978|shape|2|4326|POINT
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
postgis/postgis.sql.in | 12 ++++++------
regress/core/tickets.sql | 19 +++++++++++++++++++
regress/core/tickets_expected | 5 +++++
4 files changed, 31 insertions(+), 6 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list