Re: Exclusive Locks Taken on User Tables? - Mailing list pgsql-general

From Simon Riggs
Subject Re: Exclusive Locks Taken on User Tables?
Date
Msg-id 1194436449.4251.49.camel@ebony.site
Whole thread Raw
In response to Re: Exclusive Locks Taken on User Tables?  (Marc <pgsql-general@mbreslow.net>)
List pgsql-general
On Tue, 2007-11-06 at 15:53 -0500, Marc wrote:
> Ok.  I'll keep looking at pg_locks.
>
> My original reason for reaching out to the list was over confusion as
> to when an EXCLUSIVE lock would be taken table level since the
> documentation says this should never happen except to some system
> catalogs.  Is there something missing from the documentation?  I feel
> like that would be a big clue.  Here is what I'm referencing:
> http://www.postgresql.org/docs/8.2/interactive/explicit-locking.html

OK, I see what you mean.

This page:
http://www.postgresql.org/docs/8.2/interactive/view-pg-locks.html
references the section on titled Table-level Locks, rather than
referencing the locking chapter in general.

The docs don't discuss that ExclusiveLock applies to the locktype, not
to the Table in all cases, which could easily be inferred from what is
there. I've had that question before myself.

The tuple level ExclusiveLocks you are seeing are locking only the rows;
the table containing those rows will not be ExclusiveLock-ed.

The docs are correct in what they say about *table-level* (i.e. relation
as referred to by pg_locks) ExclusiveLocks.

I'll submit a patch.

--
  Simon Riggs
  2ndQuadrant  http://www.2ndQuadrant.com


pgsql-general by date:

Previous
From: Reg Me Please
Date:
Subject: Re: prepared statements suboptimal?
Next
From: rihad
Date:
Subject: Re: prepared statements suboptimal?