osm2pgrouting
osm2pgrouting copied to clipboard
Use the .pgpass file contents
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.
@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.
Should we also use Travis and Appveyor for osm2pgrouting?
eventually also Appveyor.