Re: Exclusive Locks Taken on User Tables?

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Marc <pgsql-general(at)mbreslow(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Richard Huxton <dev(at)archonet(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Exclusive Locks Taken on User Tables?
Date: 2007-11-07 11:54:09
Message-ID: 1194436449.4251.49.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message André Volpato 2007-11-07 12:08:46 Re: Postgresql simple query performance question
Previous Message Reg Me Please 2007-11-07 11:38:27 Re: prepared statements suboptimal?