R: Field's position in Table

Поиск
Список
Период
Сортировка
От Scara Maccai
Тема R: Field's position in Table
Дата
Msg-id 310458.51343.qm@web24616.mail.ird.yahoo.com
обсуждение исходный текст
Ответ на Field's position in Table  (Kalai R <softlinne.kv@gmail.com>)
Ответы Re: R: Field's position in Table
Список 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 по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Field's position in Table
Следующее
От: vinny
Дата:
Сообщение: Re: R: Field's position in Table