Re: SELECT Generating Row Exclusive Locks? - Mailing list pgsql-general

From Thomas F. O'Connell
Subject Re: SELECT Generating Row Exclusive Locks?
Date
Msg-id 483A120B-E66E-4D2E-A21F-BDC184A388C9@sitening.com
Whole thread Raw
In response to Re: SELECT Generating Row Exclusive Locks?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: SELECT Generating Row Exclusive Locks?
List pgsql-general
On Nov 30, 2005, at 10:52 PM, Tom Lane wrote:

> "Thomas F. O'Connell" <tfo@sitening.com> writes:
>> For instance, if a long SELECT were running against table_foo and an
>> UPDATE arrived wanting to update table_foo, I would expect to see in
>> pg_locks an entry corresponding to the SELECT with granted = true and
>> an entry corresponding to the UPDATE with granted = false.
>
> Why would you expect to see that exactly?  SELECTs don't block
> UPDATEs.

Mm. I must've been projecting my notion of a problem onto one that
wasn't there, reading (and not thinking) Row Exclusive instead of
Access Exclusive for conflicts. Duh.

I guess I'm still somewhat puzzled by the original statement of the
question, then. Why does that particular view of locks occasionally
tie a SELECT to a granted Row Exclusive lock? I recognize that the
pid in pg_locks can be the pid of the server process holding or
awaiting the lock, but I'm seeing granted = true on these, which
implies that the server process corresponding to the SELECT is
holding a Row Exclusive, doesn't it?

--
Thomas F. O'Connell
Database Architecture and Programming
Co-Founder
Sitening, LLC

http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005 (cell)
615-469-5150 (office)
615-469-5151 (fax)

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: SELECT Generating Row Exclusive Locks?
Next
From: "surabhi.ahuja"
Date:
Subject: Re: postgres log file