Re: PG_DUMP and table locking in PG7.4

From: Yann Michel <yann-postgresql(at)spline(dot)de>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Yann Michel <yann-postgresql(at)spline(dot)de>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PG_DUMP and table locking in PG7.4
Date: 2005-11-16 08:27:55
Message-ID: 20051116082755.GA7140@zoom.spline.inf.fu-berlin.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-11-16 08:31:03 Re: [HACKERS] Per-table freeze limit proposal
Previous Message Michael Paesold 2005-11-16 07:29:51 Re: PG_DUMP and table locking in PG7.4