Re: [HACKERS] SERIAL data type - Mailing list pgsql-hackers

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: [HACKERS] SERIAL data type
Date
Msg-id m0zHfCy-00006FC@druid.net
Whole thread Raw
In response to SERIAL data type  (t-ishii@sra.co.jp (Tatsuo Ishii))
List pgsql-hackers
Thus spake Tatsuo Ishii
> o explicit insertion to the serial column sets the value specified.
>   This is good. However, next implicit insertion results in that
>   previous value from the sequence + 1 is set.
>
>   create table t (c text, i serial);
>   insert into t values('a');
>   insert into t values('b',100);
>   insert into tvalues('c');
>   select * from t;
>
>    a   1
>    b    100
>    c    2
>
>   This seems a little bit unnatural for me. may be i of the thrid row
>   should be 101?

Perhaps it should not be possible to specify a value for serial types.
Make it always use the next value no matter what is supplied.  Could
make dump and restore a problem of course but I can think of some
situations where it would make the programming simpler.

--
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

pgsql-hackers by date:

Previous
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: [HACKERS] Serial Data Type
Next
From: "Billy G. Allie"
Date:
Subject: Re: [HACKERS] SERIAL data type