best way to check pgdump

Поиск
Список
Период
Сортировка
Искать

best way to check pgdump

От:
Janet Jacobsen <jsjacobsen@lbl.gov>
Дата:
Hi.  What is the best way to check a pgdump
without doing a restore?

Thanks,
Janet

Re: best way to check pgdump

От:
Raymond O'Donnell <rod@iol.ie>
Дата:
On 23/06/2010 04:52, Janet Jacobsen wrote:
> Hi.  What is the best way to check a pgdump
> without doing a restore?

If you used one of the binary formats for pg_dump, you can have
pg_restore list the contents without actually restoring the database.

If you did a text dump, just look into the file. :-)

Ray.

-- 
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: best way to check pgdump

От:
Adrian Klaver <adrian.klaver@gmail.com>
Дата:
On Wednesday 23 June 2010 4:12:40 am Raymond O'Donnell wrote:
> On 23/06/2010 04:52, Janet Jacobsen wrote:
> > Hi.  What is the best way to check a pgdump
> > without doing a restore?
>
> If you used one of the binary formats for pg_dump, you can have
> pg_restore list the contents without actually restoring the database.

http://www.postgresql.org/docs/8.3/interactive/app-pgrestore.html

To add, pg_restore has an -f switch that allows you to restore a binary dump to 
a file. To quote from above:

"pg_restore can operate in two modes. If a database name is specified, the 
archive is restored directly into the database. Otherwise, a script containing 
the SQL commands necessary to rebuild the database is created and written to a 
file or standard output. The script output is equivalent to the plain text 
output format of pg_dump. Some of the options controlling the output are 
therefore analogous to pg_dump options. "


This is quite handy as allows you store dumps in the compressed binary format 
and retrieve specific information as needed in a human readable form.

>
> If you did a text dump, just look into the file. :-)
>
> Ray.
>
> --
> Raymond O'Donnell :: Galway :: Ireland
> rod@iol.ie



-- 
Adrian Klaver
adrian.klaver@gmail.com
FAQ