Re: split pg_dumpall backups per database

Поиск
Список
Период
Сортировка
От Andrej Ricnik-Bay
Тема Re: split pg_dumpall backups per database
Дата
Msg-id b35603930803111037g68894783r34d4eae073edcacd@mail.gmail.com
обсуждение исходный текст
Ответ на split pg_dumpall backups per database  (Luca Ferrari <fluca1978@infinito.it>)
Список pgsql-general
On 11/03/2008, Luca Ferrari <fluca1978@infinito.it> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Joshua
Дата:
Сообщение: basic plpgsql / sql funtion question
Следующее
От: "Mike"
Дата:
Сообщение: Re: message contents do not agree with length in message type "T"