Using the following command:
% pg_dump -h postgres.cs.host.ca -p 5433 -n _cscf_subscription -Fc -f ~/old.dump odyssey_prod
Password:
pg_dump: [archiver (db)] connection to database "cs-rsub" failed: FATAL: password authentication failed for user "cs-rsub"
FATAL: password authentication failed for user "cs-rsub"
Yet psql works fine:
% psql -U _cscf_subscription -d odyssey_prod -h postgres.cs.host.ca -p 5433
psql (9.3.4, server 9.2.4)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.
postgres=> \q
It is odd that pg_dump does not simply use the .pgpass file like psql does, however even pasting and manually typing in the password that is stored in the .pgpass file into the pg_dump password prompt still fails to authenticate. I an using the same account, same role, and same host.
What could be going wrong here?
In case the versions matter at all:
SELECT version();
executed via the working psql returns:
PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit
And pg_dump --version
is:
pg_dump (PostgreSQL) 9.3.4
I doubt this would matter but psql --version
is:
psql (PostgreSQL) 9.3.4
Any ideas to what is going wrong?