| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера