Re: restore a dump db from tar file - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: restore a dump db from tar file
Date
Msg-id 48EA3D67.9030502@iol.ie
Whole thread Raw
In response to Re: restore a dump db from tar file  ("Alain Roger" <raf.news@gmail.com>)
Responses Re: restore a dump db from tar file  ("Alain Roger" <raf.news@gmail.com>)
List pgsql-general
On 06/10/2008 16:12, Alain Roger wrote:

> AFAIK, pg_dump -v -o -U username -ci -Ft -f tarname.tar dbname
> backup the DB but without inserting code to create the BD itself... just

What's -ci? Looking at the docs, there's are -c and -i options, but I
don't see -ci.

> how can i do that automatically ?
> i mean when i dump my db, how can i dump ALSO the script to create the
> BD and its property ?

From the docs:

<quote>
-C
--create

    Begin the output with a command to create the database itself and
reconnect to the created database. (With a script of this form, it
doesn't matter which database you connect to before running the script.)

    This option is only meaningful for the plain-text format. For the
archive formats, you can specify the option when you call pg_restore.
</quote>

So it seems that you can't do it when using a non-text format - you'll
have to do a plain-text dump, and maybe pipe it to tar if you want that.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: restore a dump db from tar file
Next
From: "Alain Roger"
Date:
Subject: Re: restore a dump db from tar file