NEXT VALUE FOR sequence - Mailing list pgsql-hackers

From Laurenz Albe
Subject NEXT VALUE FOR sequence
Date
Msg-id 1519041831.2503.15.camel@cybertec.at
Whole thread Raw
Responses Re: NEXT VALUE FOR sequence
Re: NEXT VALUE FOR sequence
List pgsql-hackers
The SQL standard has the expression "NEXT VALUE FOR asequence" to do
what we traditionally do with "nextval('asequence')".

This is an attempt to implement this on top of the recently introduced
NextValueExpr node.

If there is no obvious reason why we would not want that, I'll add it
to the next commitfest.

Is this behavior ok:

test=> CREATE SEQUENCE testseq;
test=> PREPARE x AS SELECT NEXT VALUE FOR testseq;
test=> EXECUTE x;
 ?column? 
----------
        1
(1 row)

test=> DROP SEQUENCE testseq;
DROP SEQUENCE
test=> EXECUTE x;
ERROR:  could not open relation with OID 24836

If not, what could be done about it?

Yours,
Laurenz Albe
Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: extern keyword incorrectly used in some function definitions
Next
From: Arthur Zakirov
Date:
Subject: Re: Prefix operator for text and spgist support