osm2pgrouting icon indicating copy to clipboard operation
osm2pgrouting copied to clipboard

Use the .pgpass file contents

Open jmarca opened this issue 8 years ago • 3 comments

osm2pgrouting requires a password, even though I have a .pgpass file, as described here: https://www.postgresql.org/docs/9.5/static/libpq-pgpass.html

Most other psql access libraries automatically use this file.

It does seem to respect the PGPASSWORD environment variable described here: https://www.postgresql.org/docs/9.5/static/libpq-envars.html, but it is more convenient to use the .pgpass file, esp. when connecting to different databases and machines.

jmarca avatar May 27 '16 17:05 jmarca

@robe2 I am working on this issue, I created the following branch in my fork: https://github.com/cvvergara/osm2pgrouting/tree/v3/pgpass

2 things:

thing 1)

I am using some linux stuff than probably needs some wrapping for windows: See this file handle_pgpass.cpp for example line 23:

 auto filename(getenv("PGPASSFILE"));

maybe its different in Windows

thing 2)

I want to use libpqxx the c++ version of libpq

So there is a small test for connection here: https://github.com/cvvergara/osm2pgrouting/blob/v3/pgpass/src/osm_elements/osm2pgrouting.cpp#L117

So I want to know if that works on windows.

I added this file that finds libpqxx: https://github.com/cvvergara/osm2pgrouting/blob/v3/pgpass/cmake/FindLibPQXX.cmake

maybe needs some refinement.

cvvergara avatar Oct 18 '16 22:10 cvvergara

Should we also use Travis and Appveyor for osm2pgrouting?

dkastl avatar Oct 19 '16 02:10 dkastl

eventually also Appveyor.

cvvergara avatar Oct 19 '16 14:10 cvvergara