Search Postgresql Archives

Re: split pg_dumpall backups per database

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

 



On 11/03/2008, Luca Ferrari <fluca1978@xxxxxxxxxxx> wrote:
> Hi all,
>  is it possible to instrument pg_dumpall to produce separate sql files for each
>  database it is going to backup? I'd like to keep separate backups of my
>  databases, but using pg_dump can lead to forgetting a database.....

You could use the method described here for a single database:
http://archives.postgresql.org/pgsql-general/2008-02/msg00343.php

Just slap a wrapper around it (untested),  out.sql being the name of
the dump-file:

for i in  $(awk '/^CREATE DATABASE/ {print $3}' out.sql); do dump.sh
${i} out.sql  ${i}.sql; done

Of course you won't be getting the creation of specific roles or
anything that way.


>  Thanks,
>  Luca
Cheers,
Andrej

-- 
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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