Andrew Dunstan wrote:
>
> Bruce Momjian wrote:
>> Log Message:
>> -----------
>> Update:
>>
>> < * Allow adding enumerated values to an existing enumerated data
>>
>>> * Allow adding/removing enumerated values to an existing enumerated data
>
> Where did this come from? Adding values anywhere except on the end of
> the enumeration list will be fraught with danger, as will removing them.
> In essence, either operation would entail rewriting every table that
> used the type. Anything else carries a major risk of corruption. That
> seems like a pretty bad idea.
We already support rewriting tables ... (albeit only one at a time, I
admit. Doing it for more than one can cause deadlocks).
Still, if the user wants to pay the cost, why should we prohibit it?
Perhaps we should add a pg_depend entries on tables using the type (or
we have them already), and disallow modifying it unless there are no
users of it. So the user can create a new enum with the options he
wants, then rewrite his tables one by one, then drop the original.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support