Re: VALUES() evaluation order - Mailing list pgsql-general

From Steve Atkins
Subject Re: VALUES() evaluation order
Date
Msg-id 762CE8D5-B5D9-4A6D-A2AB-8CB9A4B90599@blighty.com
Whole thread Raw
In response to Re: VALUES() evaluation order  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Jan 13, 2013, at 2:36 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

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

Thanks. WITH it is, then.

Cheers,
  Steve

pgsql-general by date:

Previous
From: Chris Ernst
Date:
Subject: Re: Linux Distribution Preferences?
Next
From: Chris Angelico
Date:
Subject: Re: Linux Distribution Preferences?