Re: Altering table error
| От | Nabil Sayegh |
|---|---|
| Тема | Re: Altering table error |
| Дата | |
| Msg-id | 1053950134.7807.16.camel@billy обсуждение исходный текст |
| Ответ на | Altering table error (Josep Sànchez i Mesegué <jsmesegue@transpujol.com>) |
| Ответы |
Re: Altering table error
|
| Список | pgsql-novice |
Am Mon, 2003-05-19 um 11.43 schrieb Josep Sànchez i Mesegué:
> | provesmasis-# ERROR: Adding columns with defaults is not implemented.
> | provesmasis-# Add the column, then use ALTER TABLE SET DEFAULT.
>
> What am I doing wrong?
serial is a 'macro'
It is an integer with an auto-increment value.
The auto-increment is implemented as a
default nextval('HERE_COMES_A_SEQUENCE_seq'::text)
But: Alter table with defaults is not implemented.
So you have to
1. add an int column cap_id (instead of serial).
2. create a sequence
3. alter the table again and SET DEFAULT nextval('YOUR_SEQ_seq'::text);
BTW: What version of postgresql are you using ?
HTH
--
e-Trolley Sayegh & John, Nabil Sayegh
Tel.: 0700 etrolley /// 0700 38765539
Fax.: +49 69 8299381-8
PGP : www.e-trolley.de
В списке pgsql-novice по дате отправления: