Re: ALTER TABLE modifications

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: ALTER TABLE modifications
Дата
Msg-id 1068828247.35839.80.camel@jester
обсуждение исходный текст
Ответ на Re: ALTER TABLE modifications  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-patches
> lock table
> create newtable as select c1, c2, c3::newtype
> modify pg_class to point to the new filename
> modify existing pg_attribute for the column in question
> recreate indexes that exist on the column
> unlock table

I actually tried this to start with an ran into several dead-ends in
trying to rebuild constraints, defaults, etc.  In order to do this I
think you would need to create a second pg_class entry and do a full
table swap.

By far, the easiest method to preserve order without writing a ton of
additional code is to do something that is on the TODO list already,
separate the visible position from physical position.

Doing the above has lots of added benefits, where spending a ton of time
on TYPE change has very few benefits.


В списке pgsql-patches по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ALTER TABLE modifications
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: ALTER TABLE modifications