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

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Dunstan <pgsql(at)tomd(dot)cc>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Brendan Jurd <direvus(at)gmail(dot)com>, Bruce Momjian <momjian(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Date: 2008-04-26 13:44:23
Message-ID: 20080426134423.GD10366@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Andrew Dunstan escribió:

> Tom Dunstan wrote:
>> So two alternative proposals, both with a 2 byte "enum id" and a 2 byte "value":
>>
>> 1 - We space the values out as evenly as we can across the 65000ish
>> range and allow people to delete, insert and append, but not reorder.
>> If they do the above gratuitously we might have to do a rewrite, but
>> they'll have to get fairly busy to do it. Rewrite would be required
>> for reorderings.
>
> Or else we just error out in such cases. As Tom Lane suggests, rewriting
> has some nasty deadlock possibilities.
>
> You always have the option of creating a new enum type and moving each
> affected column to that type.

Another alternative would be internally creating a different temporary
enum, rewriting the tables one by one each on its own transaction, and
finish by dropping the original enum and renaming the temporary one.
This solves the deadlock problem.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2008-04-26 15:18:41 Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Previous Message Robert Treat 2008-04-26 13:10:53 Re: Re: [HACKERS] [COMMITTERS] pgsql: Fix TransactionIdIsCurrentTransactionId() to use binary search

Browse pgsql-hackers by date

  From Date Subject
Next Message Aidan Van Dyk 2008-04-26 13:48:00 Re: Proposed patch - psql wraps at window width
Previous Message Bruce Momjian 2008-04-26 13:44:05 Re: Proposed patch - psql wraps at window width