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