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


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to