Re: Behavior of nextval() and currval() - Mailing list pgsql-general

From Tom Lane
Subject Re: Behavior of nextval() and currval()
Date
Msg-id 3099.1005677613@sss.pgh.pa.us
Whole thread Raw
In response to Re: Behavior of nextval() and currval()  (Mike Mascari <mascarm@mascari.com>)
List pgsql-general
Mike Mascari <mascarm@mascari.com> writes:
> I've switched to using a CREATE TEMPORARY TABLE AS SELECT..,
> INSERT..SELECT to avoid the scenario.

Uh, you mean something like

    select a, a from (select nextval('foo') as a) as b;

That might surprise you even more :-(

Perhaps the planner shouldn't pull up subqueries whose targetlists
include any noncachable functions.  This needs more thought.

            regards, tom lane

pgsql-general by date:

Previous
From: Mike Mascari
Date:
Subject: Re: Behavior of nextval() and currval()
Next
From: Mike Mascari
Date:
Subject: Re: Behavior of nextval() and currval()