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

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Дата
Msg-id 481347D1.4080700@dunslane.net
обсуждение исходный текст
Ответ на Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-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.

cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: we don't have a bugzilla
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: we don't have a bugzilla