Re: pg_restore - Mailing list pgsql-bugs

From John R Pierce
Subject Re: pg_restore
Date
Msg-id 50C3C188.6050701@hogranch.com
Whole thread Raw
In response to pg_restore  (Branka Stancic <brankastancic@hotmail.com>)
List pgsql-bugs
On 12/5/2012 4:40 AM, Branka Stancic wrote:
> I have problem.
> I want to restore only data in database.
> In pgAdmin I was backup only data from old database and now i have
>  backup file backup.sql.
> In terminale I want restore only data in new database and I using
> command pg_restore -i -h localhost -p 5432 -U postgres -d payroll
> --data-only -v "/home/postgres/backup.sql",
> but i get an error:
> pg_restore:[archiver] input file appears to be a text format
> dump.Please use psql

pg_restore is only for binary dumps such as are generated by pg_dump -Fc

plain text dumps are restored with psql -f filename.sql

if you dumped just the data, then thats all it will restore (data only
mean it won't create the tables and such),   but you probably should
truncate the existing tables first if there's old data in them.

pgsql-bugs by date:

Previous
From: Gavin Flower
Date:
Subject: Re: Installing PG 7.3.4 on Linux 6
Next
From: Tom Lane
Date:
Subject: Re: BUG #7741: Two bugs when backing up databases with default privileges defined on public schema