On Thu, Oct 27, 2005 at 10:34:57PM -0400, Andrew Dunstan wrote:
> 
> 
> Jim C. Nasby wrote:
> 
> >On Thu, Oct 27, 2005 at 09:45:05PM -0400, Andrew Dunstan wrote:
> > 
> >
> >>Jim C. Nasby wrote:
> >>
> >>   
> >>
> >>>Andrew, you mentioned that if you want to change the ordering you should
> >>>just create a new type. What about if you need to change the values that
> >>>are in the enum? MySQL does (or at least did, it's been some time since
> >>>I've messed with this) a horrible job at that. There's no way to rename
> >>>anything; you have to add the new names you want, then do a bulk update,
> >>>then delete the (now old) names. IMO this is broken.
> >>>
> >>>
> >>>     
> >>>
> >>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
> >something?
> > 
> >
> 
> Because you are not just changing the name of something.

No, I was refering specifically to the case of wanting to rename
something. IE: you setup an enum for sky colors (blue, black), and then
the PHB issues an edict that the daytime sky is now green. In this case
you (or at least I) don't want to define a new enum, I just want to
change 'blue' to 'green' in that enum. There's no reason it needs to hit
the table at all.
-- 
Jim C. Nasby, Sr. Engineering Consultant      [EMAIL PROTECTED]
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to