Re: pg_restore - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: pg_restore
Date
Msg-id 47251777.2000700@iol.ie
Whole thread Raw
In response to Re: pg_restore  (Bob Pawley <rjpawley@shaw.ca>)
List pgsql-general
On 28/10/2007 22:40, Bob Pawley wrote:

> pg_dump -h localhost -d  Aurel -U postgres
 >
 > Could you suggest a dump command that will match the restore command -
 >
 > pg_restore  -h localhost -d PDW -U postgres  aurel.sql

One thing that caught me, and I suspect may be catching you also -
somewhat confusingly, in pg_restore the -d option specifies the database
to which to restore; in pg_dump it instead causes the data to be dumped
as INSERT statements rather than COPY.

I can see why things may work this way (pg_dump always needs to be
pointed at a database, whereas pg_restore doesn't if the dump is going
to create the database)....but it can trap the unwary.

See the docs at
http://www.postgresql.org/docs/8.2/static/reference-client.html

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_restore
Next
From: Thomas Kellerer
Date:
Subject: Re: pg_restore