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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Allow deleting enumerated values from an existing enumerated data type
Дата
Msg-id 1081742.1695926782@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Allow deleting enumerated values from an existing enumerated data type  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Allow deleting enumerated values from an existing enumerated data type  (Vik Fearing <vik@postgresfriends.org>)
Re: Allow deleting enumerated values from an existing enumerated data type  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> I wonder if we could have a boolean flag in pg_enum, indicating that 
> setting an enum to that value was forbidden.

Yeah, but that still offers no coherent solution to the problem of
what happens if there's a table that already contains such a value.
It doesn't seem terribly useful to forbid new entries if you can't
get rid of old ones.

Admittedly, a DISABLE flag would at least offer a chance at a
race-condition-free scan to verify that no such values remain
in tables.  But as somebody already mentioned upthread, that
wouldn't guarantee that the value doesn't appear in non-leaf
index pages.  So basically you could never get rid of the pg_enum
row, short of a full dump and restore.

We went through all these points years ago when the enum feature
was first developed, as I recall.  Nobody thought that the ability
to remove an enum value was worth the amount of complexity it'd
entail.

            regards, tom lane



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Allow deleting enumerated values from an existing enumerated data type
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Index range search optimization