Re: best way to check pgdump

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, rod(at)iol(dot)ie
Cc: Janet Jacobsen <jsjacobsen(at)lbl(dot)gov>
Subject: Re: best way to check pgdump
Date: 2010-06-23 14:23:45
Message-ID: 201006230723.45709.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)iol(dot)ie

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ashesh Vashi 2010-06-23 14:40:12 Re: missing uuid functions in postgresql-contrib RPM for linux?
Previous Message Devrim GÜNDÜZ 2010-06-23 14:09:06 Re: missing uuid functions in postgresql-contrib RPM for linux?