Re: SELECT FOR UPDATE differs inside and outside a pl/pgsql - Mailing list pgsql-bugs

From Tom Lane
Subject Re: SELECT FOR UPDATE differs inside and outside a pl/pgsql
Date
Msg-id 19667.1071760293@sss.pgh.pa.us
Whole thread Raw
In response to Re: SELECT FOR UPDATE differs inside and outside a pl/pgsql  (Mark Shewmaker <mark@primefactor.com>)
List pgsql-bugs
Mark Shewmaker <mark@primefactor.com> writes:
> On Wed, 2003-12-17 at 19:57, Tom Lane wrote:
>> Mark Shewmaker <mark@primefactor.com> writes:
>>> If a "FOR UPDATE executes before LIMIT" rule stopped the function
>>> from ever locking a row, it's still curious why didn't it stop the
>>> direct command from ever locking a row as well.
>>
>> I think it would.  Did you try the test the other way around (with the
>> direct command being blocked behind someone who deletes the first row)?

> Yes, or at least I've done the test that I think you're asking about.

So you have.  Your session B_1 (second column) shows exactly the
behavior I expected: the first invocation of SELECT FOR UPDATE
fails to lock any row.  You manually did the equivalent of looping
as in myfunction().  So it looks the same to me.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #1013: Authentication doesn't work
Next
From: Rich Hall
Date:
Subject: Re: plpgsql For SQLQuery Loop Flags Error