Re: swapping relfilenodes (was: Re: locks in CREATE TRIGGER,

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: swapping relfilenodes (was: Re: locks in CREATE TRIGGER,
Date: 2005-03-23 14:47:45
Message-ID: 877jjy771q.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > In fact, would a truncate during a backup cause the backup to be
> > inconsistent because it wouldn't be a true snapshot of the database at
> > backup start time? Seems so.
>
> No, because pg_dump holds AccessShareLock on every table that it intends
> to dump, thereby ensuring that TRUNCATE/CLUSTER/etc are held off. The
> proposal to weaken the locks that those operations take would in fact
> break pg_dump.

It seems like that would be true for TRUNCATE but not CLUSTER.

Though pg_dump works in READ COMMITTED mode doesn't it? So it doesn't really
get a consistent view of the database exactly anyways. If it tried to go in
SERIALIZABLE mode I suspect it would rarely complete though.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Huxton 2005-03-23 14:49:53 Re: help with corrupted database
Previous Message Greg Stark 2005-03-23 14:45:40 Re: locks in CREATE TRIGGER, ADD FK