Re: [HACKERS] tablelevel and rowlevel locks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Jenny - <nat_lazy(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] tablelevel and rowlevel locks
Date: 2003-09-05 01:12:40
Message-ID: 18539.1062724360@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> Anyway, I think the LOCK structure represents something that can be locked.

Right.

> The PROCLOCK struct represents that some process is holding a lock on said
> object.

IIRC, a PROCLOCK is created as soon as some backend tries to lock some
lockable object. So the PROCLOCK may only indicate that that backend is
waiting for a lock on that object, not that it already has one.

> That may be the reason why you are seeing that a lock is held by more
> than one process at the same time (while in fact some of them are probably
> _waiting_ for the lock).

Also keep in mind that we use a lot of sharable lock modes --- so it's
entirely likely that multiple processes actually do have locks on the
same object. That's not wrong if their lock modes don't conflict.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Relaxin 2003-09-05 01:24:01 Re: descending Indexes
Previous Message Tom Lane 2003-09-05 00:58:18 Re: descending Indexes

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-09-05 01:14:42 psql \h alter scrolls of screen
Previous Message Bruce Momjian 2003-09-05 01:12:10 Re: SET CONSTRAINTS and like named constraints