Re: NEXT VALUE FOR - Mailing list pgsql-hackers

From Tom Lane
Subject Re: NEXT VALUE FOR
Date
Msg-id 6116.1412291928@sss.pgh.pa.us
Whole thread Raw
In response to Re: NEXT VALUE FOR  (Thomas Munro <munro@ip9.org>)
Responses Re: NEXT VALUE FOR
List pgsql-hackers
Thomas Munro <munro@ip9.org> writes:
> On 2 October 2014 14:48, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Have you checked the archives about this?  My recollection is that one
>> reason it's not in there (aside from having to reserve "NEXT") is that
>> the standard-mandated semantics are not the same as nextval().

> Right, I found the problem: "If there are multiple instances of <next value
> expression>s specifying the same sequence generator within a single
> SQL-statement, all those instances return the same value for a
> given row processed by that SQL-statement."  This was discussed in a thread
> from 2002 [1].

Wow, it was that far back?  No wonder I didn't remember the details.

> I suppose one approach would be to use command
> IDs as the scope.

The spec clearly says one value per row, not one per statement; so
command ID is very definitely not the right thing.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Marti Raudsepp
Date:
Subject: Re: CREATE IF NOT EXISTS INDEX
Next
From: Joe Conway
Date:
Subject: Re: DDL Damage Assessment