> THE TEST
> Run 'psql', then enter the following except for the select statement
> output.
>
> ---BEGIN---
> create table test (name char, a int, b int);
> insert into test values ('x', 1, 2);
> select * from test;
> update test set a=3,b=a where name='x';
> insert into test values ('y', 1, 2);
> update test set b=a,a=3 where name='y';
> select * from test;
> name | a | b
> ------+---+---
> x | 3 | 1
> y | 3 | 1
> drop table test;
> ---END---
>
> I am used to MySQL so I expected the following from the select
> statement.
> name | a | b
> ------+---+---
> x | 3 | 3
> y | 3 | 1
>
> Which behavior is the correct?
I believe ours...
>From update positioned:
"The <value expression>s are effecitvely evaluated before
updating the object row. If a <value expression> contains a
reference to a column of T, then the reference is to the value
of that column in the object row before any value of the object
row is updated."
>From update searched:
"The <value expressions> are effectively evaluated for each row
of T before updating any row of T."