Connection parameters for imposm fail because of special characters

99 Views Asked by At

I want to run imposm to import OSM data to a PostGIS DB. My problem is that the password for the DB contains special characters like ":" (a colon). I cannot change the password.

The documentation states to use the connection parameter like this:

The -connection option takes a URL in the format postgis://username:password@host:port/databasename or a list of parameters like postgis: host=/tmp dbname=osm

However, this produces an error because of the special characters in the password.

 parsing database connection URL: parse "postgres://user:pss?wo:r?d!@host/osm": invalid port ":r?d" after host

The documentation also says to use a list of parameters but it is not clear to me how these parameters have to be named.

Does anyone know how to pass the connection parameters with a list instead of the URL encryption? I can only find host and dbname and I dont't know how to write the connection excatly. Or is there a possibility to escape special characters in the URL?

1

There are 1 best solutions below

0
On BEST ANSWER

You must encode the special characters.

If your password is pss?wo:r?d!, the connection URL would be

postgresql://user:pss%3Fwo%3Ar%3Fd%21@host/osm