Re: [GENERAL] VALUES() evaluation order

2013-01-14 Thread Daniel Verite
Tom Lane wrote: > Consider sticking the nextval() into a WITH. This is also a reminder that PG's nextval() differs on this from the SQL standard, which says: "If there are multiple instances of s specifying the same sequence generator within a single SQL-statement, all those instances re

Re: [GENERAL] VALUES() evaluation order

2013-01-13 Thread Steve Atkins
On Jan 13, 2013, at 2:36 PM, Tom Lane wrote: > Steve Atkins 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

Re: [GENERAL] VALUES() evaluation order

2013-01-13 Thread Tom Lane
Steve Atkins 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 implementa