Re: pg_restore

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: pg_restore
Date: 2012-12-08 22:39:04
Message-ID: 50C3C188.6050701@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

  • pg_restore at 2012-12-05 12:40:31 from Branka Stancic

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-12-09 05:15:18 Re: BUG #7741: Two bugs when backing up databases with default privileges defined on public schema
Previous Message Gavin Flower 2012-12-08 18:48:59 Re: Installing PG 7.3.4 on Linux 6