Re: VALUES() evaluation order

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: VALUES() evaluation order
Дата
Msg-id 257.1358116602@sss.pgh.pa.us
обсуждение исходный текст
Ответ на VALUES() evaluation order  (Steve Atkins <steve@blighty.com>)
Ответы Re: VALUES() evaluation order  (Steve Atkins <steve@blighty.com>)
Re: VALUES() evaluation order  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-general
Steve Atkins <steve@blighty.com> writes:
> Is the order in which the expressions in a VALUES() clause defined?
> I'm doing this: INSERT INTO foo (a, b) VALUES (nextval('bar'), currval('bar'))

> It works fine, but I'm wondering whether it's guaranteed to work or whether I'm relying on an artifact of the
implementation.

I'd say it's an artifact.  It probably does work reliably at the moment,
but if we had a reason to change it we'd not feel much compunction about
doing so.  (The most obvious potential reason to change it is parallel
evaluation of expressions, which is a long way off, so you probably
don't have any near-term reason to worry.  But ...)

Consider sticking the nextval() into a WITH.

            regards, tom lane


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

Предыдущее
От: Steve Atkins
Дата:
Сообщение: VALUES() evaluation order
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: Linux Distribution Preferences?