Re: PG_DUMP and table locking in PG7.4 - Mailing list pgsql-hackers

From Yann Michel
Subject Re: PG_DUMP and table locking in PG7.4
Date
Msg-id 20051116082755.GA7140@zoom.spline.inf.fu-berlin.de
Whole thread Raw
In response to Re: PG_DUMP and table locking in PG7.4  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: PG_DUMP and table locking in PG7.4  (Martijn van Oosterhout <kleptog@svana.org>)
Re: PG_DUMP and table locking in PG7.4  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

first of all, thanks to all, that replied!

On Wed, Nov 16, 2005 at 08:28:31AM +0100, Martijn van Oosterhout wrote:
> On Wed, Nov 16, 2005 at 08:09:31AM +0100, Yann Michel wrote:
> > Well, thanks for all the answers. Are the locks then released once they
> > are not needed any more like in 2PC?
> 
> 2PC doesn't release any locks, it can't to maintain integrity.

Aehm. sorry I meant 2PL ... all this accronyms... ;-)
The normal 2PL releases the locks once they are not needed anymore but
can not aquire new ones. Strict 2PL releases them all at one point.

> > That should still leaqve the taken snapshot of the released table in a
> > consistent state but might enable other transactions to work on that one
> > table once it is released. 
> 
> ACCESS SHARE means what it says, it stops the table being VACUUMed and
> a few other things, but doesn't block INSERTs, UPDATEs or DELETEs.

Thanks. BTW: Is there anything about locks and their meaning inside of
the Docs? If not, wouldn't that be nice?

> pg_dump doesn't blocks inserts, so your problem must be somewhere
> else... Are you running VACUUM anywhere. It's possible that pg_dump is
> blocking VACUUM which blocks your inserts...

Well, now that I'm thinking about, what you've written I think this is
exactly the point. I think, that there is a VACUUM waiting for the dump
to finish whereas the INSERTS are waiting for the VACUUM to finish.

Thannks!

Cheers,
Yann


pgsql-hackers by date:

Previous
From: Michael Paesold
Date:
Subject: Re: PG_DUMP and table locking in PG7.4
Next
From: Peter Eisentraut
Date:
Subject: Re: [COMMITTERS] pgsql: Translation typo fix