Re: [HACKERS] tablelevel and rowlevel locks - Mailing list pgsql-general

From Tom Lane
Subject Re: [HACKERS] tablelevel and rowlevel locks
Date
Msg-id 18539.1062724360@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] tablelevel and rowlevel locks  (Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>)
List pgsql-general
Alvaro Herrera Munoz <alvherre@dcc.uchile.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: descending Indexes
Next
From: Jan Wieck
Date:
Subject: Re: Replaceing records