[SCM] PostGIS branch stable-3.3 updated. 3.3.7-23-g102b938f4
git at osgeo.org
git at osgeo.org
Tue Apr 22 11:31:43 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.3 has been updated
via 102b938f4425d3722546bf5b14b51360b43a2615 (commit)
from 9393fc711c42e94ef4712ed1d42a8c470e17e6e8 (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 102b938f4425d3722546bf5b14b51360b43a2615
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Apr 22 11:25:57 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 a4833b070..5649c66a4 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Proj 4.9+ required.
* Bug Fixes and Enhancements *
- #5876, Fix ST_AddPoint with empty point argument (Paul Ramsey)
+ - #5829, geometry_columns with non-standard constraints (Paul Ramsey)
PostGIS 3.3.8
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 5bf355a08..2bebee475 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -6305,26 +6305,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