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

From Tom Lane
Subject Re: BUG #1231: Probelm with transactions in stored code.
Date
Msg-id 11422.1093488391@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #1231: Probelm with transactions in stored code.  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Responses Re: BUG #1231: Probelm with transactions in stored code.  (Gaetano Mendola <mendola@bigfoot.com>)
List pgsql-bugs
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> I believe it sees the one that was valid in the snapshot as of the
> beginning of the function.

Actually, the problem is that it can see *both* that row and the updated
row; it's a crapshoot which one will be returned by the SELECT INTO.

The reason this can happen is that we're not doing SetQuerySnapshot
between commands of a plpgsql function.  There is discussion going way
way back about whether we shouldn't do so (see the archives).  I think
the major reason why we have not done it is fear of introducing
non-backwards-compatible behavior.  Seems like 8.0 is exactly the right
version to consider doing that in.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: server crash in very big transaction [postgresql 8.0beta1]
Next
From: "John R Pierce"
Date:
Subject: Re: BUG #1232: Singapore Timezone missing