pg_restore - authentication failed?

Started by Zlatko Matićover 20 years ago2 messagesgeneral
Jump to latest
#1Zlatko Matić
zlatko.matic1@sb.t-com.hr

Hello.
I have a strange problem when trying to use pg_restore to restore data from
a backup, on WIN XP, PostgreSQL 8.0.3.

If I use PgAdmin it works, but if I copy the command to .bat file
authentication fails although I enter correct password.
The .bat script is the following:

cd D:\Program Files\PostgreSQL\8.0\bin
pg_restore.exe -i -h localhost -p 5432 -U postgres -d
"MYDATABASE" -a --disable-triggers -t mytablename -v
"C:\BACKUP\MYDATABASE_DATA_BCP_Fc.fcbackup"

and the error is:
pg_restore: [archiver (db)] connection to database "MYDATABASE" failed:
FATAL: password authentication failed for user "postgres"

I also tried to pass password by pgpass.conf file, but without result. If I
use PgAdmin, it works....

What could be the reason ? Is this a bug ?

Zlatko

#2Richard Huxton
dev@archonet.com
In reply to: Zlatko Matić (#1)
Re: pg_restore - authentication failed?

Zlatko Matić wrote:

If I use PgAdmin it works, but if I copy the command to .bat file
authentication fails although I enter correct password.
The .bat script is the following:

and the error is:
pg_restore: [archiver (db)] connection to database "MYDATABASE" failed:
FATAL: password authentication failed for user "postgres"

I also tried to pass password by pgpass.conf file, but without result.
If I use PgAdmin, it works....

What could be the reason ? Is this a bug ?

Unlikely. Is pgadmin connecting to localhost on port 5432? I'm thinking
there might be something in your pg_hba.conf

--
Richard Huxton
Archonet Ltd