Re: Use of nextval, currval

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Use of nextval, currval
Дата
Msg-id 3343.1036740563@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Use of nextval, currval  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-novice
"Josh Berkus" <josh@agliodbs.com> writes:
>> I believe that I can replace this in Postgres with:
>>
>> insert into TABLE (id1,.......,id2)
>> values (nextval('DataId'),.....,currval('DataId');
>>
>> What I think is expected is that the values of id1 and id2 will be
>> equal.

> This is correct.

Well ... it's relying on the assumption that the elements of the VALUES
list will be evaluated left-to-right.  Which is true at the moment,
and I don't really expect it to change, but it still could be called an
unsafe dependency on undocumented implementation details.  I doubt you
will find anything in the SQL spec that requires implementations to
behave that way.

            regards, tom lane

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

Предыдущее
От: Ludwig Lim
Дата:
Сообщение: Some questions on KEYS
Следующее
От: Setyo Nugroho
Дата:
Сообщение: Where is the saved database?