Opened 36 hours ago

#5829 new defect

SELECT geometry_columns returns unexpected error when there are constraints after SRID constraint.

Reported by: nbvfgh Owned by: pramsey
Priority: critical Milestone: PostGIS 3.6.0
Component: postgis Version: 3.5.x
Keywords: Cc:

Description

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

Change History (0)

Note: See TracTickets for help on using tickets.