Re: NEXT VALUE FOR...

From: Rod Taylor <pg(at)rbt(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: NEXT VALUE FOR...
Date: 2004-05-07 18:52:46
Message-ID: 1083955965.28644.16.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Fri, 2004-05-07 at 14:38, Tom Lane wrote:
> Rod Taylor <pg(at)rbt(dot)ca> writes:
> > 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").
>
> I see one pretty big problem with this: the SQL2003 spec says clearly
> that multiple occurrences of NEXT VALUE FOR should all generate the same
> value within a particular row. (See, eg, last sentence of 4.21.2 or the
<snip>
> Offhand I see no simple way to do what the spec asks for within Postgres
> :-( but that doesn't mean we should ignore the requirement.

You're right. I had missed that.

Does that mean the below insert should give both col1 and col2 the same
value?

CREATE TABLE test (
col1 integer DEFAULT NEXT VALUE FOR t_seq,
col2 integer DEFAULT NEXT VALUE FOR t_seq
);

INSERT INTO TABLE DEFAULT VALUES;

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2004-05-07 19:06:15 Re: Dollar Quoting doc patch--resend.
Previous Message Thomas Hallgren 2004-05-07 18:47:32 Patch for Makefile.shlib