Opened 6 years ago

Last modified 5 years ago

#4108 new defect

Tiger geocoder regex escaping with invalid address in normalize_address()

Reported by: bryandatanerds Owned by: robe
Priority: medium Milestone: PostGIS Fund Me
Component: tiger geocoder Version: 2.4.x
Keywords: Cc:

Description

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.

Change History (2)

comment:1 by pramsey, 6 years ago

Milestone: PostGIS 2.4.5PostGIS 2.4.6

comment:2 by komzpa, 5 years ago

Milestone: PostGIS 2.4.6PostGIS Fund Me
Note: See TracTickets for help on using tickets.