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