1

In reference to this question:

PostgreSQL Job Scheduling: Creating Schedule Backup using Bat File

It made me successful to have a back-up for my database.

Filename: Database_backup.backup

However, using PgAdmin III using Restore selection, i wasn't able to restore it, it shows Error:

C:\Program Files\PostgreSQL\9.4\bin\pg_restore.exe --host localhost --port 5432 --username "postgres" --dbname "db_name" --no-password --list "C:\Users\Name\Documents\Backup_20160805.backup" pg_restore: [archiver] input file appears to be a text format dump. Please use psql.

What I am missing here?

Is it in Backup?

Again, I need your guidance here.

Thanks so much.


1 Answer 1

2

pg_dump, which is called by pgAdmin III to perform backups, can create them in four formats:

  • plain: SQL commands
  • custom: compressed proprietary binary format
  • directory: one backup file per table
  • tar: like "directory", but as a tar archive

There is a "format" dropdown in pgAdmin III that lets you select the format.

To restore a plain format dump, you'll have to execute the SQL script with pgAdmin III or psql.

For the other three formats, you use pg_restore, which is internally called by pgAdmin III's "restore" functionality.

So you took a plain format dump, which causes the reported error with pg_restore. Execute it as a SQL script instead!

Sign up to request clarification or add additional context in comments.

2 Comments

Hi @Laurez Albe, thanks for the suggestion. But what i have backup here is thru batch file. Please see above-mentioned link how to create backup. I'm having issues when i use it to restore function in pgAdmin III.
That's what I say. Either make the dump as you do now and restore by executing it as SQL script, or take the dump in a different format and restore it the way you are trying to do now. That script you're using isn't immutable. It contains a call to pg_dump. If you want custom format, just add the -Fcto it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.