[PostGIS] #5829: SELECT geometry_columns returns unexpected error when there are constraints after SRID constraint.
PostGIS
trac at osgeo.org
Tue Apr 22 09:40:20 PDT 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
Resolution: | Keywords:
-----------------------+---------------------------
Comment (by robe):
Replying to [comment:1 pramsey]:
> I come at this with two impulses:
>
> * One is just to remove the constraint-reading bits of the view, since
they date back to pre-2.0 postgis, when we didn't have typmods.
> * The other is to replace the string manipulation stuff with a single
regex.
>
> {{{
> # select pg_get_constraintdef(177252);
>
> pg_get_constraintdef
> -------------------------------------------------------
> CHECK (((st_srid(geom) = 4326) AND st_isvalid(geom)))
>
> ^
> # select regexp_match(
> pg_get_constraintdef(177252),
> 'st_srid\(\w+\)\s*=\s*(\d+)', 'i');
>
> regexp_match
> --------------
> {4326}
> }}}
>
> That would be more reliable than the current code and leave in place the
constraint support, for those 15 year old legacy systems we care about.
I suppose removing it entirely would make the view faster.
Though I don't like its a breaking change and hard to tell how many rely
on that.
I know for one my tiger geocoder still uses constraints, but I personally
don't rely on that view for anything I don't think, not sure if there are
any that do.
I'm not sure your regex is non-standard conforming.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5829#comment:2>
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