[SCM] PostGIS branch stable-3.5 updated. 3.5.2-25-g9def18cd1
git at osgeo.org
git at osgeo.org
Tue Apr 22 11:10:45 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 9def18cd1b348febd5fdc4edf9364b7e5e1ab31f (commit)
from 922bcd0bb830d228191fd3e7a62979512bb83895 (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 9def18cd1b348febd5fdc4edf9364b7e5e1ab31f
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Apr 22 11:02:25 2025 -0700
geometry_columns view fails with non-standard use of postgis functions in constraint definition, references #5829
diff --git a/NEWS b/NEWS
index 9a0f46525..1d5ebd279 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required.
- Fix misassignment of result in _lwt_HealEdges (Maxim Korotkov)
- #5876, ST_AddPoint with empty argument adds garbage (Paul Ramsey)
- #5874, Line substring returns wrong answer (Paul Ramsey)
+- #5829, geometry_columns with non-standard constraints (Paul Ramsey)
PostGIS 3.5.2
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 7394698c2..bdf9879ca 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -6398,26 +6398,29 @@ CREATE OR REPLACE VIEW geometry_columns AS
JOIN pg_type t ON a.atttypid = t.oid
LEFT JOIN ( SELECT s.connamespace,
s.conrelid,
- s.conkey, replace(split_part(s.consrc, ''''::text, 2), ')'::text, ''::text) As type
+ s.conkey,
+ (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 ~~* '%geometrytype(% = %'::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, replace(split_part(s.consrc, ' = '::text, 2), ')'::text, ''::text)::integer As ndims
+ s.conkey,
+ (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 ~~* '%ndims(% = %'::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, replace(replace(split_part(s.consrc, ' = '::text, 2), ')'::text, ''::text), '('::text, ''::text)::integer As srid
+ s.conkey,
+ (regexp_match(s.consrc, 'st_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 ~~* '%srid(% = %'::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"]))
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
postgis/postgis.sql.in | 15 +++++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list