This will be probably extreme novice question but I want to restore a .backup dump file. I have tried the following command:

pg_restore -i -h localhost -p 5432 -U postgres -d old_db -v C:/blabla/bla.backup

First error I have encountered because the dump file is in text format so I should restore it using psql.

Then I have tried this command:

psql dbname < C:/blabla/bla.backup

But didn't accept the password of my windows user password

  • Do you have a database user? One of the differences between the two commands is -U postgres – dezso May 21 '13 at 12:21
  • yes I have just one db user "postgres" but the second command does not accept the password of the windows user. It is in german but something like authentication for the user "mtuna" was not succesful – mctuna May 21 '13 at 12:26
  • psql dbname postgres < C:/blabla/bla.backup solved the problem thanks – mctuna May 21 '13 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.