[SCM] PostGIS branch stable-3.5 updated. 3.5.3-49-gdc7cf169b
git at osgeo.org
git at osgeo.org
Fri Sep 5 15:57:04 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.5 has been updated
via dc7cf169b3d1bb6d018d99cd0322be2b10f5098b (commit)
from eaddd48b81f445b2b6dd72f9f45d7aeb8043acc3 (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 dc7cf169b3d1bb6d018d99cd0322be2b10f5098b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Fri Sep 5 15:56:57 2025 -0700
#5978, fix parsing of constraints in geometry_columns
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 6469a9703..4d3fc19c0 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -6399,28 +6399,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 cf519dff0..da041a517 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1561,3 +1561,22 @@ SELECT '#5747', ST_Length('MULTISURFACE (((0 0, 1 0, 1 1, 0 1, 0 0)), CURVEPOLYG
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 35b8ce430..15065d870 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -482,3 +482,8 @@ ERROR: Geometry contains invalid coordinates
#5686|0
#5747|0
#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:
postgis/postgis.sql.in | 12 ++++++------
regress/core/tickets.sql | 19 +++++++++++++++++++
regress/core/tickets_expected | 5 +++++
3 files changed, 30 insertions(+), 6 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list