rustprooflabs / pgosm-flex

PgOSM Flex provides high quality OpenStreetMap datasets in PostGIS (Postgres) using the osm2pgsql Flex output.
MIT License
100 stars 20 forks source link

Allow special characters in DB connection parts #386

Closed rustprooflabs closed 4 months ago

rustprooflabs commented 4 months ago

Details

Addresses #383, tests based on #384.

This approach uses urllib.prase.quote() to handle special characters in Postgres passwords and other conn string components. This allows continuing to use URI style connection strings. There are a variety of places throughout the code that expect URI style connections.

The quote() method appears to handle the requirements defined by Postgres.

"The connection URI needs to be encoded with percent-encoding if it includes symbols with special meaning in any of its parts. Here is an example where the equal sign (=) is replaced with %3D and the space character with %20:" From Postgres libpq connection docs

Thank you @jmealo for all the sleuthing you did to determine the cause of the issue and suggesting a path forward! I'll get an updated :latest image pushed soon, will comment here when that's ready.

jmealo commented 4 months ago

@rustprooflabs: thanks for addressing this so quickly.