Re: next value expression - Mailing list pgsql-hackers

From Tom Lane
Subject Re: next value expression
Date
Msg-id 20702.1038422770@sss.pgh.pa.us
Whole thread Raw
In response to Re: next value expression  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> There's already a need to reform the way in which the next value of a
> sequence is produced (nextval() makes it difficult to get the dependancy
> information right); would it be a good idea to change it to be
> completely SQL compatible at the same time?

What do you consider "completely SQL compatible" here?  In particular,
what is a "statement"?  My initial reaction to this part of the SQL
draft is that it's broken.  Consider plpgsql functions invoked within
an interactive statement --- if they invoke nextval() should it fail to
increment across repeated attempts?  Does your answer change if the
functions are invoked as triggers, rather than directly in the text of
the statement?  How about queries inserted by rule rewriting; are those
separate statements for this purpose?  In any of these contexts I think
you can construct examples that would favor either answer.

ISTM that we will have all the same issues with this that we had with
the question of when "now()" should increment...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [INTERFACES] ANNOUNCE: DBD::Pg 1.20
Next
From: "Dan Langille"
Date:
Subject: Re: contrib/ltree patches