I'm using two tools here in university, wich both work with the same postgres database. The one written in Java uses the jdbc-driver and that works just fine.
The second one written in C++ has some difficulties. It gives me following error
Ident authentication failed for user "xyz"
The connection string looks like this
dbname=myDB user=xyz hostaddr=127.0.0.1 port=5432 connect_timeout=10 password=myPW
I checked the values like 10 times and the are exactly the same in both applications. I thought it might be the pg_hba.cfg. So I tried a lot and finally got all doors open:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
local all postgres ident
local all all password
# IPv4 local connections:
host all all 192.168.185.0/24 trust
host all postgres 127.0.0.1/32 ident
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 ident
How can it be, that the C++ tool always tries to go with the indent authentification method despite a password is given. (Or is it the db..?) Are there any special cases in libpqxx I have to lookout for?