Re: ALTER COLUMN/logical column position

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: ALTER COLUMN/logical column position
Дата
Msg-id 1069315111.3201.99.camel@fuji.krosing.net
обсуждение исходный текст
Ответ на ALTER COLUMN/logical column position  (Andreas Pflug <pgadmin@pse-consulting.de>)
Ответы Re: ALTER COLUMN/logical column position
Список pgsql-hackers
Andreas Pflug kirjutas N, 20.11.2003 kell 01:38:

> Second, column type changes needing a nontrivial cast function should be 
> implemented in a way that preserve attnum. This could be done like this:
> - decompile dependent objects, and memorize them for later recreation
> - ADD tmpCol, UPDATE tmpCol=col::newtype, DROP old column, cascading to 
> dependent objects, RENAME tmpCol (known stuff)
> - restore old attnum, which is a simple UPDATE to pg_attribute at this stage

and suddenly your table is broken, as you can't retrieve the tmpCol when
the attnum points to the dropped old column which has data in the format
for old type ...

the whole point of separating attnum and attpos is that attnum is used
internally to retrieve the data and you can't change it by just
UPDATEing pg_attribute.

---------------
Hannu



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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: RPM building fun
Следующее
От: Shridhar Daithankar
Дата:
Сообщение: Re: RPM building fun