Search Postgresql Archives

Re: restore a dump db from tar file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux