Link to home
Start Free TrialLog in
Avatar of Taras Shumylo
Taras Shumylo

asked on

pg_dump doesn't ask me for password but produce error "Ident authentication failed"

I run
pg_dump test_database -U test_user -h localhost > backup

Open in new window

and get
pg_dump: [archiver (db)] connection to database "test_database" failed: FATAL:  Ident authentication failed for user "test_user"

Open in new window


It DOES NOT ask me to enter password

If I run
pg_dump test_database -U test_user -W -h localhost > test_database.bck

Open in new window


I get password prompt, but after entering password same error.

How can I authenticate to make pg_dump?
Avatar of Abhimanyu Suri
Abhimanyu Suri
Flag of United States of America image

Please try

pg_dump -d test_database -u test_user
Avatar of Taras Shumylo
Taras Shumylo

ASKER

I get

pg_dump: invalid option -- 'd'
Try "pg_dump --help" for more information.

Open in new window

If I run
sudo -i -u test_user

Open in new window

And then
pg_dump test_database > test_database.bck

Open in new window

the command succeed
But if I run
sudo -i -u test_user

Open in new window

and then
pg_dump test_database -U test_user -h localhost > test_database.bck

Open in new window

I got error
pg_dump: [archiver (db)] connection to database "test_database" failed: FATAL:  Ident authentication failed for user "test_user"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Taras Shumylo
Taras Shumylo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nobody provided solution.