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