Re: Allow deleting enumerated values from an existing enumerated data type

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Allow deleting enumerated values from an existing enumerated data type
Дата
Msg-id 4755493c-a25c-1332-d2c1-900bd02fb125@dunslane.net
обсуждение исходный текст
Ответ на Re: Allow deleting enumerated values from an existing enumerated data type  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Allow deleting enumerated values from an existing enumerated data type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2023-09-28 Th 10:28, Tom Lane wrote:
> =?UTF-8?B?0JTQsNC90LjQuyDQodGC0L7Qu9C/0L7QstGB0LrQuNGF?= <danil.stolpovskikh@gmail.com> writes:
>> I would like to offer my patch on the problem of removing values from enums
>> It adds support for expression ALTER TYPE <enum_name> DROP VALUE
>> <value_name>
> This does not fix any of the hard problems that caused us not to
> have such a feature to begin with.  Notably, what happens to
> stored data of the enum type if it is a now-deleted value?
>
>             


I wonder if we could have a boolean flag in pg_enum, indicating that 
setting an enum to that value was forbidden. That wouldn't delete the 
value but it wouldn't show up in enum_range and friends. We'd have to 
teach pg_dump and pg_upgrade to deal with it, but that shouldn't be too 
hard.


Perhaps the command could be something like


ALTER TYPE enum_name DISABLE value;


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




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

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: [HACKERS] pg_upgrade failed with error - ERROR: column "a" in child table must be marked NOT NULL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Allow deleting enumerated values from an existing enumerated data type