Re: ALTER COLUMN/logical column position - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: ALTER COLUMN/logical column position
Date
Msg-id 1069315111.3201.99.camel@fuji.krosing.net
Whole thread Raw
In response to ALTER COLUMN/logical column position  (Andreas Pflug <pgadmin@pse-consulting.de>)
Responses Re: ALTER COLUMN/logical column position
List 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 by date:

Previous
From: David Fetter
Date:
Subject: Re: RPM building fun
Next
From: Shridhar Daithankar
Date:
Subject: Re: RPM building fun