[PostGIS] #5633: postgis_extensions_upgrade() breaks and signalize unbalanced parenteses in regex of regexp_replace function
PostGIS
trac at osgeo.org
Mon Dec 4 13:18:34 PST 2023
#5633: postgis_extensions_upgrade() breaks and signalize unbalanced parenteses in
regex of regexp_replace function
---------------------------+-----------------------------------------------
Reporter: hci | Owner: strk
Type: enhancement | Status: assigned
Priority: low | Milestone: PostGIS PostgreSQL
Component: upgrade/soft | Version: 3.3.x
Resolution: | Keywords: upgrade extensions regexp_replace
---------------------------+-----------------------------------------------
Comment (by robe):
strk I think the proper way to write this to not care about what the
standard_conforming_strings setting is is force escape like so
So you need 2 \\s instead of 1 slash to escape the (
{{{
pg_catalog.regexp_replace(rec.proc::text,
E'_deprecated_by_postgis[^(]*\\(.*',
}}}
With that, this query seems to work properly regardless if I have
standard_conforming_strings on or off
{{{
SELECT pg_catalog.regexp_replace(rec.proc::text,
E'_deprecated_by_postgis[^(]*\\(.*', '' ), proc
FROM (SELECT oid, oid::regprocedure AS proc, proname FROM pg_proc)
AS rec
WHERE proname ~ 'deprecated_by_postgis'
}}}
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5633#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