Take the 2-minute tour ×

I'm trying to get a site up and running and have the .asp source files and a .backup of the PostgreSQL database.

I keep getting errors while trying to restore the Postgres backup: "Process returned exit code 0." I've already created a new db and added tables through the pgadmin GUI, I get the error when I right click on the empty table and select restore.

Anyone with Postgres experience available to help out, or point me in the direction of some specific documentation?

share|improve this question

closed as off topic by vyegorov, M42, Sankar Ganesh, alxx, Stony Feb 20 '13 at 8:43


How was the backup created? The key points are 1. Is it a data only backup? If you've already created tables, you're expecting that it is, so we want to make sure of that. 2. Is the backup going to try to create the database too? Again, if you've already created the database you're expecting it won't, but just checking. 3. Is the backup compressed, or is it a SQL dump? This changes your options for restoring it and finding out the answers to questions 1 and 2. –  Scott S Feb 19 '13 at 22:47
I'm new to postgres so I'm not sure. My best guess is it is a compressed backup (based merely on the fact that it is a .backup and not a .sql). As for whether or not it will create tables, the only place I saw that would allow a "restore" from a "backup" is the right click on the actual table in the empty db. –  Vince Feb 19 '13 at 23:16
what is the process for restoring a backup without restoring it to a manually created db/table? –  Vince Feb 19 '13 at 23:18
Exit code 0 is success. What are the prior error(s) if any? As for identifying the file, open a copy of it or open it read only in a text editor; are the first few bytes the characters PGDMP? If so, it's a pg_dump -Fc custom-format dump that should be restored using pg_restore. This is what PgAdmin-III will do automatically, and it sounds like that's what you're using, so you should be fine. Usually you'd restore the whole database to an empty DB though, not manually create the tables then attempt to restore into them. –  Craig Ringer Feb 19 '13 at 23:37
Yes, it is a PGDMP "PGDMPq XXXXXXXXXXXXXXXXXXXXENCODINGENCODINGSET client_encoding = 'UTF8';" Is this something I can restore using the GUI in PgAdmin, if so how: because the restore option is not available (from what I see) unless I manually create the table and right click on it? OR is this something I need to do in the command line in pg_restore? –  Vince Feb 20 '13 at 18:40

1 Answer 1

Use the client application pg_restore to restore from an archive created by pg_dump in one of the non-plain-text formats.

share|improve this answer
