On Thu, 24 Nov 2005 07:51:03 -0500, Thomas Harold wrote:
> According to my reading of the pgsql documentation, the two basic backup
> scripts are pg_dump and pg_dumpall. pg_dump allows you to dump a single
> database to a file, while pg_dumpall dumps all of the databases to a
> single file.
>
> Currently, we use MSSQL's built-in backup facility. That allows us,
> with a single command, to dump every database to separate files on a
> daily basis (and we keep 14-days online). That makes recovering from a
> glitch in one of the databases very easy, and it's rather simple to go
> back to a particular day.
> So, now for the questions:
[SNIP]
>
> 1) Is there a tool (or is this easily scripted in bash?) that would
> iterate through the databases in pgsql and dump them to individual
> files? I'm guessing that we would query pg_databases and dump the
> database names to a file (how?) and then parse that to feed to pg_dump
> (I can figure this bit out myself).
{SNIP}
The FreeBSD port installs a script called 502.pgsql that dumps each
database to a separate file. It looks like it is close to what you
are looking for.
http://www.freebsd.org/cgi/cvsweb.cgi/ports/databases/postgresql81-server/
files/502.pgsql?rev=1.7&content-type=text/x-cvsweb-markup