omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
721 stars 158 forks source link

Imposm seems to always use password auth, cannot connect to unix socket via peer auth #43

Closed xicesky closed 7 years ago

xicesky commented 9 years ago

With imposm2 i could use postgis:///mapnik to use the unix socket. But:

    bin/imposm3 import -mapping mapping.json -connection postgis:///mapnik -write

gives me:

    pq: password authentication failed for user "mapnik"

It does not seem possible to specify a socket path directly using the URL syntax, because lib/pq splits the host name after the first slash. (e.g. you cannot write "postgis:///var/run/postgresql/mapnik")

So i tried the following:

    PG_HOST=/var/run/postgresql bin/imposm3 import -mapping mapping.json -connection "postgis:///mapnik" -write

but still:

    pq: password authentication failed for user "mapnik"

I am not a go expert, but is there a way to tell imposm (or lib/pq) to not use password auth?

yohanboniface commented 9 years ago

@xicesky Did you finally find any workaround for this?

xicesky commented 9 years ago

Yes, by using TCP instead, and setting up password authentication for the user that imposm uses to connect to the Database. Since this worked for me, i didn't bother trying to patch the code.

yohanboniface commented 9 years ago

OK, this is what I'm doing locally, but I don't like having password in my servers ;) I'll see for a better option later. Thanks for your answer :)

pnorman commented 8 years ago

A workaround is

PGHOST=/path/to/socket/directory/ imposm3 ... -connection="postgis:///dbname" ...

olt commented 7 years ago

-connection='postgis: dbname=osm host=/path/to/socket' is now supported with 29d1882

ireznik commented 3 years ago

A workaround is

PGHOST=/path/to/socket/directory/ imposm3 ... -connection="postgis:///dbname" ...

THANK YOU. That helped me alot