WIP: extensible enums

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема WIP: extensible enums
Дата
Msg-id 4C7240CD.8090306@dunslane.net
обсуждение исходный текст
Ответы Re: WIP: extensible enums  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: WIP: extensible enums  ("David E. Wheeler" <david@kineticode.com>)
Re: WIP: extensible enums  (Thom Brown <thom@linux.com>)
Re: WIP: extensible enums  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Attached is a WIP patch that allows enums to be extended with additional
labels arbitrarily. As previously discussed, it works by adding an
explicit sort order column to pg_enum. It keeps track of whether the
labels are correctly sorted by oid value, and if so uses that for
comparison, so the possible performance impact on existing uses, and on
almost all cases where a label is added at the end of the list, should
be negligible.

Open items include

    * some additional error checking required
    * missing documentation
    * pg_upgrade considerations


To add a label at the end of the list, do:

  ALTER TYPE myenum ADD 'newlabel';

To add a label somewhere else, do:

  ALTER TYPE myenum ADD 'newlabel' BEFORE 'existinglabel';

or

  ALTER TYPE myenum ADD 'newlabel' AFTER 'existinglabel';


I'm not wedded to the syntax. Let the bikeshedding begin.

cheers

andrew



Вложения

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: More vacuum stats
Следующее
От: Marko Kreen
Дата:
Сообщение: Re: UTF16 surrogate pairs in UTF8 encoding