On Dec 19, 2009, at 11:24 AM, Andrus wrote:
set transaction isolation level read uncommitted; create temp table test1 ( a int, b int) on commit drop; insert into test1 values(1,2); update test1 set a=4, b=a ; select * from test1 b value is 1 but must be 4. How to use updated value ?
The problem here isn't the transaction isolation level. The order of evaluation in an UPDATE statement is (for practical purposes): Evaluate all of the right-hand side expressions, and then assign them all to the left-hand side fields.
It's not clear why you need to do it this way, though. Presumably, since you did some kind of computation that came up with the number '4', you can assign that value instead of using the field a:
UPDATE test1 set a=4, b=4; -- -- Christophe Pettus xof@xxxxxxxxxxxx -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general