Re: extensible enum types - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: extensible enum types
Date
Msg-id 4C1BA01B.9080202@dunslane.net
Whole thread Raw
In response to Re: extensible enum types  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: extensible enum types  ("David E. Wheeler" <david@kineticode.com>)
Re: extensible enum types  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: extensible enum types  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: extensible enum types  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers

Robert Haas wrote:
> On Fri, Jun 18, 2010 at 11:50 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
>   
>> Then set the
>> first value at  8 * p, then next at 9* p and so on. This is designed to
>> allow more space to add labels at the beginning and end of the list, where
>> this is more likely. Adding a label would be a matter of finding the labels
>> adjacent to the position where we want to add the new label, and placing it
>> half way between them, possibly with special rules for the list ends. If we
>> want to add the label between two labels having values n and n+1 the
>> addition would fail.
>>     
>
> I like the idea of being able to modify enums on the fly, but I'm
> skeptical of an implementation that won't always work.  Maybe it's
> still better than what we have now, but it seems grotty.
>
>   

I'd be perfectly happy to hear a reasonable alternative. Assuming we use 
some integer representation, given two labels represented by n and n+1, 
we can't add a label between them without rewriting the tables that use 
the type, whether it's my representation scheme or some other. Maybe we 
could have a FORCE option which would rewrite if necessary.

cheers

andrew


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: extensible enum types
Next
From: "David E. Wheeler"
Date:
Subject: Re: extensible enum types