Re: split pg_dumpall backups per database

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Luca Ferrari <fluca1978(at)infinito(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: split pg_dumpall backups per database
Date: 2008-03-11 09:25:47
Message-ID: 20080311092547.GA1297@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2008-03-11 09:26:11 Re: gsoc ideas
Previous Message Richard Huxton 2008-03-11 09:24:15 Re: split pg_dumpall backups per database