Re: WIP: extensible enums

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Greg Stark <gsstark@mit.edu>, Robert Haas <robertmhaas@gmail.com>, Dean Rasheed <dean.a.rasheed@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2010-10-24T16:48:04Z
Lists: pgsql-hackers

On 10/24/2010 12:20 PM, Tom Lane wrote:
>   With float4 the implementation would fail at somewhere
> around 2^24 elements in an enum (since even with renumbering, there
> wouldn't be enough bits to give each element a distinguishable value).
> I don't see that as a real objection, and anyway if you were trying
> to have an enum with many elements, you'd want the in-memory
> representation to be compact.

Anything beyond the square root of this is getting pretty insane, 
IMNSHO, so I'm really not that bothered by that number.

Assuming we renumber the sortorder as even positive integers, that 
number comes down a couple of bits, but even so that gives us lots of 
head room I think.

cheers

andrew