Re: [HACKERS] SERIAL data type
| От | darcy@druid.net (D'Arcy J.M. Cain) |
|---|---|
| Тема | Re: [HACKERS] SERIAL data type |
| Дата | |
| Msg-id | m0zHfCy-00006FC@druid.net обсуждение исходный текст |
| Ответ на | SERIAL data type (t-ishii@sra.co.jp (Tatsuo Ishii)) |
| Список | 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 по дате отправления: