[PostGIS] #5829: SELECT geometry_columns returns unexpected error when there are constraints after SRID constraint.

PostGIS trac at osgeo.org
Sun Jan 5 23:54:15 PST 2025


#5829: SELECT geometry_columns returns unexpected error when there are constraints
after SRID constraint.
----------------------+---------------------------
 Reporter:  nbvfgh    |      Owner:  pramsey
     Type:  defect    |     Status:  new
 Priority:  critical  |  Milestone:  PostGIS 3.6.0
Component:  postgis   |    Version:  3.5.x
 Keywords:            |
----------------------+---------------------------
 {{{
 DROP TABLE IF EXISTS test;
 create table test (geom geometry);

 ALTER TABLE test ADD CONSTRAINT c1 CHECK (ST_SRID(geom)=4326 and
 ST_IsValid(geom));

 SELECT * FROM geometry_columns;

 -- ERROR:  invalid type integer input syntax: "4326 AND st_isvalidgeom"
 }}}

 If the order of the two constraints is reversed:
 {{{
 DROP TABLE IF EXISTS test;
 create table test (geom geometry);

 ALTER TABLE test ADD CONSTRAINT c1 CHECK (ST_IsValid(geom) and
 ST_SRID(geom)=4326);

 SELECT * FROM geometry_columns;

 -- normal result
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5829>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list