support for NEXT VALUE FOR expression

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: support for NEXT VALUE FOR expression
Date: 2016-08-17 03:35:29
Message-ID: 222bdd8b-7702-64e9-82f3-14ce2ca43875@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is a patch for implementing the NEXT VALUE FOR expression. This is
the SQL-standard conforming version of our nextval() function, and it's
also used by Oracle, MS SQL, DB2. Example:

SELECT NEXT VALUE FOR foo_seq;

The second patch changes the serial column to use this new expression
for its generated default values. This doesn't make an external
difference except perhaps that the generated expression looks less weird
to the user.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Add-NEXT-VALUE-FOR-expression.patch text/x-patch 24.4 KB
0002-Use-NEXT-VALUE-FOR-for-serial-columns.patch text/x-patch 8.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-08-17 03:52:50 Re: support for NEXT VALUE FOR expression
Previous Message Vince Vielhaber 2016-08-17 03:33:36 Are these supported??