Skip site navigation (1) Skip section navigation (2)

Re: [COMMITTERS] pgsql: Update: < * Allow adding enumeratedvalues to an existing

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Bruce Momjian <momjian(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumeratedvalues to an existing
Date: 2008-04-25 18:27:18
Message-ID: 20080425182718.GD5888@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-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

In response to

Responses

pgsql-hackers by date

Next:From: Brendan JurdDate: 2008-04-25 18:40:16
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Previous:From: Andrew DunstanDate: 2008-04-25 17:48:28
Subject: Re: pgsql: Update: < * Allow adding enumerated values to an existing

pgsql-committers by date

Next:From: Brendan JurdDate: 2008-04-25 18:40:16
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Previous:From: Andrew DunstanDate: 2008-04-25 17:48:28
Subject: Re: pgsql: Update: < * Allow adding enumerated values to an existing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group