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

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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
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 15:18:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committerspgsql-hackers

Alvaro Herrera wrote:
> 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.

What happens when someone tries to join two of the tables, one that has 
been converted and one that hasn't? You might not have deadlock, but you 
won't have type integrity either, ISTM.



In response to


pgsql-hackers by date

Next:From: Andrew DunstanDate: 2008-04-26 15:43:12
Subject: Re: we don't have a bugzilla
Previous:From: Joshua D. DrakeDate: 2008-04-26 15:17:59
Subject: Re: we don't have a bugzilla

pgsql-committers by date

Next:From: Tom LaneDate: 2008-04-26 17:26:44
Subject: Re: Re: [HACKERS] [COMMITTERS] pgsql: Fix TransactionIdIsCurrentTransactionId() to use binary search
Previous:From: Alvaro HerreraDate: 2008-04-26 13:44:23
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow addingenumerated values to an existing

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