Re: Database backup and restore

From: dima <_pppp(at)mail(dot)ru>
To: pgsql-admin(at)postgresql(dot)org
Cc: Dan Langille <dan(at)langille(dot)org>
Subject: Re: Database backup and restore
Date: 2002-11-25 08:44:54
Message-ID: 3DE1E306.2010209@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On first glance at dima's script it does not seem to deal with blobs,
> although could easily me made to do so.
>
> Also it does not address automated reloading. In light of the fact that
> blobs must be output by -Ft or -Fc in pg_dump, which are tar and custom
> respectively, the result of an entire db set dump would be one file of this
> type per database. Maybe the name could be used in a similar
> reverse-direction script to send each to pg_restore to reload things.
You can easily add -F? option to the script. The result of pg_dump may
be piped with gzip for large DBs as well instead of calling the 2nd
system(). I don't think blobs are really the problem. The problem i
faced before writing the script was to pass the DBA password to pg_dump
since i call it from cron.

Thanks to Colin's suggestions I improved the script a bit. One can
provide the pg_dump options in the beginning of the script as the
$pg_dump_options variable (should I move the user name/password &
options to a config file?). I added piping as well. I'll add a
workaround for huge databases this week probably.

Attachment Content-Type Size
backup.pl text/plain 1.1 KB

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message dima 2002-11-25 08:58:05 Re: Database backup and restore
Previous Message Hugh Esco 2002-11-25 06:58:11 Re: Problems invoking psql, was: Re: Troubles at