Re: Behavior of nextval() and currval()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Behavior of nextval() and currval()
Дата
Msg-id 2743.1005675167@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Behavior of nextval() and currval()  (Mike Mascari <mascarm@mascari.com>)
Ответы XML/PostgreSQL Application server now available
Список pgsql-general
Mike Mascari <mascarm@mascari.com> writes:
> The following works in 7.1. Is this behavior guaranteed or is it the
> subject of possible change in the future? Or am I just "getting
> lucky" that nextval() is evaluated before currval():

> SELECT nextval('s'), currval('s');

Hmm.  SELECT target expressions are indeed evaluated left to right at
present, and I don't see any reason to change that --- but it's not
guaranteed by the spec AFAIK.  I think you're right to be wary of
depending on it.  Why would you need to do this anyway?

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Behavior of nextval() and currval()
Следующее
От: Jo
Дата:
Сообщение: inheritance and foreign keys