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