[postgis-tickets] [PostGIS] #4108: Tiger geocoder regex escaping with invalid address in normalize_address()
PostGIS
trac at osgeo.org
Thu Jun 14 09:31:53 PDT 2018
#4108: Tiger geocoder regex escaping with invalid address in normalize_address()
----------------------------+---------------------------
Reporter: bryandatanerds | Owner: robe
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.4.5
Component: tiger geocoder | Version: 2.4.x
Keywords: |
----------------------------+---------------------------
The normalize_address() function appears not to escape address components
when using them in regular expressions:
{{{
datafactory=# select normalize_address('Apt 1) 5 Main St, Chicago, IL');
ERROR: invalid regular expression: parentheses () not balanced
CONTEXT: PL/pgSQL function normalize_address(character varying) line 379
at assignment
}}}
The address is garbage, but I would expect the value to fail cleanly and
not be treated as a regex, and I wonder whether periods are given their
wildcard behaviour too. Or is there some address validation function to
call first? Unfortunately it doesn't look like Postgres provides a
regexp_escape() function.
This is on Debian Testing (buster) with PostGIS 2.4.4 and PostgreSQL 10.4.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4108>
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