[SCM] PostGIS branch master updated. 3.5.0-282-g9a37771d5

git at osgeo.org git at osgeo.org
Tue Apr 22 11:37:28 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, master has been updated
       via  9a37771d50d045633f272dd687969684c9c272b8 (commit)
      from  5fce1e18937683b49c282d15b64e35b6791eae07 (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 9a37771d50d045633f272dd687969684c9c272b8
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Apr 22 11:33:17 2025 -0700

    Remove constraint checking from geometry_columns view, now depends on typmod exclusively, reference #5829

diff --git a/NEWS b/NEWS
index 89f7b8d6a..25788c577 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ PostGIS 3.6.0
 * Breaking Changes *
 
   - #5799, make ST_TileEnvelope clips envelopes to tile plane extent (Paul Ramsey)
+  - #5829, remove constraint checking from geometry_columns view (Paul Ramsey)
 
 * Deprecated signatures *
 
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 7394698c2..ed39bbb0b 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -6389,37 +6389,13 @@ CREATE OR REPLACE VIEW geometry_columns AS
 	n.nspname AS f_table_schema,
 	c.relname AS f_table_name,
 	a.attname AS f_geometry_column,
-	COALESCE(postgis_typmod_dims(a.atttypmod), sn.ndims, 2) AS coord_dimension,
-	COALESCE(NULLIF(postgis_typmod_srid(a.atttypmod), 0), sr.srid, 0) AS srid,
-	replace(replace(COALESCE(NULLIF(upper(postgis_typmod_type(a.atttypmod)), 'GEOMETRY'::text), st.type, 'GEOMETRY'::text), 'ZM'::text, ''::text), 'Z'::text, ''::text)::character varying(30) AS type
+	COALESCE(postgis_typmod_dims(a.atttypmod), 2) AS coord_dimension,
+	COALESCE(NULLIF(postgis_typmod_srid(a.atttypmod), 0), 0) AS srid,
+	replace(replace(COALESCE(NULLIF(upper(postgis_typmod_type(a.atttypmod)), 'GEOMETRY'::text), 'GEOMETRY'::text), 'ZM'::text, ''::text), 'Z'::text, ''::text)::character varying(30) AS type
    FROM pg_class c
 	 JOIN pg_attribute a ON a.attrelid = c.oid AND NOT a.attisdropped
 	 JOIN pg_namespace n ON c.relnamespace = n.oid
 	 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
-		   FROM (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
-				FROM pg_constraint) AS s
-		  WHERE s.consrc ~~* '%geometrytype(% = %'::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
-		   FROM (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
-			FROM pg_constraint) AS s
-		  WHERE s.consrc ~~* '%ndims(% = %'::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
-		   FROM (SELECT connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
-			FROM pg_constraint) AS s
-		  WHERE s.consrc ~~* '%srid(% = %'::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"]))
   AND NOT c.relname = 'raster_columns'::name AND t.typname = 'geometry'::name
   AND NOT pg_is_other_temp_schema(c.relnamespace) AND has_table_privilege(c.oid, 'SELECT'::text);

-----------------------------------------------------------------------

Summary of changes:
 NEWS                   |  1 +
 postgis/postgis.sql.in | 30 +++---------------------------
 2 files changed, 4 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list