Thank you very much Mr. Lane.
Would you mind explaining the code that you sent.
I would appreciate and curious to learn in fact the
meaning of the pg/pl sql statements.
--- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Kumar S <ps_postgres(at)yahoo(dot)com> writes:
> > friends=> alter table friend add column fr_id
> > NOTICE: ALTER TABLE will create implicit sequence
> "friend_fr_id_seq" for "serial" column
> > ERROR: adding columns with defaults is not
> > HINT: Add the column, then use ALTER TABLE SET
> > Can any one suggest what is wrong here.
> Just what it says: adding columns with defaults is
> not implemented.
> (It is implemented in 8.0, but that won't help you
> today.) You can
> do it by hand:
> create sequence friend_fr_id_seq;
> alter table friend add column fr_id int;
> update friend set fr_id =
> alter table friend alter column fr_id set default
> This isn't an exact substitute since the sequence
> will appear as
> a standalone object and not be hidden behind the
> "serial" column,
> but it's functionally equivalent.
> regards, tom lane
> ---------------------------(end of
> TIP 7: don't forget to increase your free space map
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
In response to
pgsql-novice by date
|Next:||From: Martin Atukunda||Date: 2004-09-20 09:24:02|
|Subject: ECPG threads|
|Previous:||From: Tom Lane||Date: 2004-09-20 03:32:21|
|Subject: Re: Creating a new column with SERIAL as data type |