Re: SERIAL type feature request - Mailing list pgsql-hackers

From Tino Wildenhain
Subject Re: SERIAL type feature request
Date
Msg-id 1133645854.5734.72.camel@Andrea.peacock.de
Whole thread Raw
In response to SERIAL type feature request  (Zoltan Boszormenyi <zboszor@dunaweb.hu>)
Responses Re: SERIAL type feature request
Re: SERIAL type feature request
List pgsql-hackers
Am Samstag, den 03.12.2005, 22:23 +0100 schrieb Zoltan Boszormenyi:
> Hi!
> 
> I would like to add an entry to PostgreSQL 8.2 TODO:
> - Extend SERIAL to a full-featured auto-incrementer type.
> 
> To achieve this, the following three requirements should be fulfilled:
> 
> 1. The statement parser should be able to handle this:
> 
> create table x (
>     id serial(N),
>     ...
> );
> 
> and behind the scenes this would translate into the "create sequence ... 
> start N"
> before creating the table.

why isnt N max_id? Or increment?
Sounds inconsistent. -1 on this.

> 2. Upon INSERTing to a serial column, explicitly given 0 value or 
> 'default' keyword
> or omitted field (implicit default) should be interchangeable.

default and omit are these. 0 would be an error. -1 on this too.

> 3. When a serial field value is given in an INSERT or UPDATE statement
> and the value is larger the the current value of the sequence then the 
> sequence
> should be modified accordingly.

sideeffects, raceconditions. -1 on this.

> This is the way Informix handles its serial type, although it doesn't seem
> to have a visible sequence bound to the serial column.

Sounds like this informix is seriously broken ;)


> Is it feasible in the 8.2 timeframe?

I hope not ;)





pgsql-hackers by date:

Previous
From: Zoltan Boszormenyi
Date:
Subject: SERIAL type feature request
Next
From: Jochem van Dieten
Date:
Subject: Re: Reducing relation locking overhead