> > It would just be a standard "ALTER TABLE foo ALTER COLUMN bar TYPE
> > newtype USING expression" operation. You would write a function that
> > took a value of the old type and returned a value of the new type and
> > use a cll to that function in the expression. Since these would be named
> > types, unlike the case in mysql where they are anonymously defined
> > inline, this would present no difficulties at all.
> But why force a re-write of the entire table just to change the name of
> Or is ALTER COLUMN TYPE smart enough to not touch anything if the
> mapping function is equality?
Nearly all ALTER TABLE commands are processed in the same way. In fact,
in some cases they are combined (ADD column is broken down then
re-combined later for a single rewrite).
You could pretty easily add this type of logic to skip the rewrite stage
if not needed.
In response to
- Re: enums at 2005-10-28 02:14:15 from Jim C. Nasby
pgsql-hackers by date
|Next:||From: Mark Kirkwood||Date: 2005-10-28 02:28:01|
|Subject: Re: TODO Item - Add system view to show free space map|
|Previous:||From: Andrew Dunstan||Date: 2005-10-28 02:20:51|
|Subject: Re: enums|