Skip site navigation (1) Skip section navigation (2)

NEXT VALUE FOR...

From: Rod Taylor <pg(at)rbt(dot)ca>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: NEXT VALUE FOR...
Date: 2004-04-20 23:18:20
Message-ID: 1082503100.80320.86.camel@jester (view raw or flat)
Thread:
Lists: pgsql-patches
It would appear the spec was approved of before we got foo.nextval, so
here it is again.

NEXT VALUE FOR and CURRENT VALUE FOR where CURRENT is an unreserved
keyword and VALUE is not reserved in any way (ident with comparison to
"value").

This allows the default of a table to depend on a sequence, CASCADE drop
of the sequence removes removes references to it.

CURRENT VALUE FOR is an extension of the spec.


This gives us almost everything required for the Sequence feature (T176)
(as per the draft).

We're missing the datatype specification on the sequence.

CREATE SEQUENCE t AS numeric(130);


Rod Taylor <rbt ( at ) rbt ( dot ) ca> writes: 
> Are you ok with the DB2 and draft-spec syntax of NEXT VALUE FOR (where
> value is not a reserved word)?  Or should I hold onto that until the
> spec has gone through the final draft / release?

By that time we'll have done the Oracle-style foo.nextval, and it'll
become kind of a moot point ;-)

			regards, tom lane

Attachment: nextval.patch
Description: text/x-patch (27.4 KB)

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2004-04-21 00:34:53
Subject: Change of CSV keywords
Previous:From: Michiel EphraimDate: 2004-04-20 21:57:14
Subject: Re: build annoyences

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group