Re: lock entire database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Benjamin <benjamin(at)netyantra(dot)com>
Cc: Scott Marlowe <smarlowe(at)qwest(dot)net>, Ron St-Pierre <rstpierre(at)syscor(dot)com>, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: lock entire database
Date: 2004-08-10 18:01:08
Message-ID: 29885.1092160868@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Benjamin <benjamin(at)netyantra(dot)com> writes:
> My idea was to lock the db on A, scp the required files onto B and then
> unlock db on A.

The only adequate "lock" for that sort of thing is to shut down the
postmaster on A. Anything less is simply not trustworthy.

There is support coming up in 8.0 for WAL archiving and point-in-time
recovery. With that, you could do the scp without any lock and then
fix up discrepancies by replaying the WAL archives for the interval that
the scp was running. Furthermore you could continue to ship WAL
segments to B to keep it up to date with A, without needing repeated
full scp's. See
http://developer.postgresql.org/docs/postgres/backup.html
for some preliminary documentation about this.

Slony looks like a pretty good alternative too, and it's available now.
But don't bother trying to roll your own replication setup. It's
unlikely that you can easily build a reliable one.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Taber, Mark 2004-08-10 18:33:30 What constitutes a pgsql session?
Previous Message David.Ventimiglia 2004-08-10 17:44:24 PGADMIN III Tools disabled w/ PostgreSQL 8.0 pginstaller