Re: How to use read uncommitted transaction level and set update order

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to use read uncommitted transaction level and set update order
Дата
Msg-id 16207.1261260123@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to use read uncommitted transaction level and set update order  (Christophe Pettus <xof@thebuild.com>)
Ответы Re: How to use read uncommitted transaction level and set update order  ("Andrus" <kobruleht2@hot.ee>)
Список pgsql-general
Christophe Pettus <xof@thebuild.com> writes:
> On Dec 19, 2009, at 11:24 AM, Andrus wrote:
>> update test1 set a=4, b=a ;

>> 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.

This is required by the SQL standard, and always has been --- I quote SQL92:

         6) The <value expression>s are effectively evaluated before updat-
            ing 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.

I would be quite surprised if there are any SQL databases that do this
differently.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Christophe Pettus
Дата:
Сообщение: Re: How to use read uncommitted transaction level and set update order
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: How to call a function that returns a refcursor ?