R: Field's position in Table - Mailing list pgsql-general

From Scara Maccai
Subject R: Field's position in Table
Date
Msg-id 310458.51343.qm@web24616.mail.ird.yahoo.com
Whole thread Raw
In response to Field's position in Table  (Kalai R <softlinne.kv@gmail.com>)
Responses Re: R: Field's position in Table  (vinny <vinny@xs4all.nl>)
List pgsql-general
> When adding a new field in the existing table, i
> want to add the filed in a particular position.

I'm afraid the only way would be re-writing the whole table (pseudo sql):

BEGIN;
create table newtable as select field1, 'newfield default value', field2 from old_table;
create_all_indexes on newtable;
drop old_table;
commit;

things get complicated if you have foreign keys pointing to old_table...








pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Field's position in Table
Next
From: vinny
Date:
Subject: Re: R: Field's position in Table