At 2002-06-13T23:07:54Z, Niall O Broin <[EMAIL PROTECTED]> writes:

> Nothing to do with BSD, Linux, or even, Gawd help us, Windows. If you
> don't take the database offline then the files which make up the database
> are not guaranteed to be in anything resembling a consistent state i.e. if
> you copy those files, in whatever manner, there's absolutely no guarantee
> that you'll be later able to use the database program to read the files.

That's the really nice thing about FreeBSD's new snapshots (in the
development tree).  When you freeze the filesystem image, it really is a
snapshot.  If all of your database files are on the same filesystem then
you're pretty much guaranteed a consistent backup, regardless of the amount
of updates being committed to the database.  Furthermore, FreeBSD's
snapshots are extremely space-efficient.  When a program modifies a block on
the filesystem, FreeBSD makes a copy of the original state of that block for
use in the snapshot.

I would re-do the backup steps as

1) Make a snapshot
2) Use dump to back up that completely static filesystem image
3) Remove the snapshot

Unfortunately, the new code hasn't been backported to the -STABLE tree yet,
which is what prompted me to ask about backing up PostgreSQL in the first
place.

> If your environment is such that taking the database offline is unacceptable
> then use must use the database's own utilities to dump the database into
> some form which may be backed up.

Space permitting, I'd think that making an (ASCII) copy of the database
contents into a file is a pretty smart idea, even if you're backing up the
DB files in another manner.
-- 
Kirk Strauser
The Strauser Group - http://www.strausergroup.com/

Reply via email to