Re: split pg_dumpall backups per database - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: split pg_dumpall backups per database
Date
Msg-id 20080311092547.GA1297@depesz.com
Whole thread Raw
In response to split pg_dumpall backups per database  (Luca Ferrari <fluca1978@infinito.it>)
List pgsql-general
On Tue, Mar 11, 2008 at 09:54:47AM +0100, Luca Ferrari 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.....

psql -qAt -c 'select datname from pg_database where datallowconn' | xargs -r -I X pg_dump -C -f X.dump X

depesz

--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: gsoc ideas
Next
From: longlong
Date:
Subject: Re: gsoc ideas