Re: Behavior of nextval() and currval()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mike Mascari <mascarm(at)mascari(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Behavior of nextval() and currval()
Date: 2001-11-13 18:53:33
Message-ID: 3099.1005677613@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mike Mascari <mascarm(at)mascari(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2001-11-13 19:11:22 Re: Behavior of nextval() and currval()
Previous Message Mike Mascari 2001-11-13 18:41:28 Re: Behavior of nextval() and currval()