Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Date
Msg-id 20080425182718.GD5888@alvh.no-ip.org
Whole thread Raw
Responses Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing  ("Brendan Jurd" <direvus@gmail.com>)
Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing  ("Tom Dunstan" <pgsql@tomd.cc>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: MERGE Specification
Next
From: "Brendan Jurd"
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing