Re: [PATCH] Alter or rename enum value

Поиск
Список
Период
Сортировка
От Emre Hasegeli
Тема Re: [PATCH] Alter or rename enum value
Дата
Msg-id CAE2gYzy2U60yhj9fpSciO+cF8AVd2_V++d6GZUiC3NeG8sWwvA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Alter or rename enum value  (Matthias Kurz <m.kurz@irregular.at>)
Ответы Re: [PATCH] Alter or rename enum value  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
> Given that you are now familiar with the internals of how enums are
> implemented would it be possible to continue the work and add the "ALTER
> TYPE <name> DROP VALUE <somevalue>" command?

I was thinking to try developing it, but I would be more than happy to
help by testing and reviewing, if someone else would do.  I don't
think I have enough experience to think of all details of this
feature.

The main problem that has been discussed before was the indexes.  One
way is to tackle with it is to reindex all the tables after the
operation.  Currently we are doing it when the datatype of indexed
columns change.  So it should be possible, but very expensive.

Another way, Thomas Munro suggested when we were talking about it,
would be to add another column to mark the deleted rows to the catalog
table.  We can check for this column before allowing the value to be
used.  Indexes can continue using the deleted values.  We can also
re-use those entries when someone wants to add new value to the
matching place.  It should be safe as long as we don't update the sort
order.



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

Предыдущее
От: Pavan Deolasee
Дата:
Сообщение: Re: Bug in two-phase transaction recovery
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: [sqlsmith] Failed assertion in joinrels.c