Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com> writes:
> Where is the problem? The problem lies in the fact that the 2nd
> transaction should have only seen the changes committed before it has
> begun, ie, x=1.
You might want to go reread this:
http://www.postgresql.org/docs/9.0/static/transaction-iso.html#XACT-READ-COMMITTED
If you don't like that behavior, you might want SERIALIZABLE mode
instead.
regards, tom lane