Re: BUG #1231: Probelm with transactions in stored code. - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: BUG #1231: Probelm with transactions in stored code.
Date
Msg-id 20040825191237.X6393@megazone.bigpanda.com
Whole thread Raw
In response to Re: BUG #1231: Probelm with transactions in stored code.  (Gaetano Mendola <mendola@bigfoot.com>)
Responses Re: BUG #1231: Probelm with transactions in stored code.
List pgsql-bugs
On Thu, 26 Aug 2004, Gaetano Mendola wrote:

> Stephan Szabo wrote:
>
> > On Wed, 25 Aug 2004, PostgreSQL Bugs List wrote:
> >
> > Actually, it shows that functions have odd behavior when locking is
> > involved (your statement would potentially be true if you could replicate
> > this without the functions).  IIRC, there are issues currently with which
> > rows you see in such functions unless you end up using FOR UPDATE on the
> > selects or something of that sort.
>
> If the first select is a "FOR UPDATE" nothing change. For sure the last select in

Right, I changed both to see if that made it "work" for me and it did.  I
didn't bother to try the only after one.

> that function doesn't see the same row if you perform that same select after
> the function execution, and for sure doesn't see the same row that the update
> statement touch.

I believe it sees the one that was valid in the snapshot as of the
beginning of the function.

pgsql-bugs by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: BUG #1231: Probelm with transactions in stored code.
Next
From: Tom Lane
Date:
Subject: Re: server crash in very big transaction [postgresql 8.0beta1]