Re: enum bug

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: enum bug
Дата
Msg-id 20160314020826.GA185772@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: enum bug  (Melvin Davidson <melvin6925@gmail.com>)
Ответы Re: enum bug  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-general
Melvin Davidson wrote:

> Enums are evil!
> http://www.lornajane.net/posts/2010/is-enum-evil

???

This post is about MySQL's enums, which aren't really related to
Postgres enums:

    "In order to change the allowed values of an enum column, we
    need to issue an alter table statement [...]   Alter table
    actually creates a new table matching the new structure, copies
    all the data across, and then renames the new table to the right
    name."

This is not at all how things happen in Postgres' enums.


> enums are from before there were foreign keys

In Postgres, ENUMs are pretty recent actually -- a lot newer than FKs:

commit 57690c6803525f879fe96920a05e979ece073e71
Author:     Tom Lane <tgl@sss.pgh.pa.us>
AuthorDate: Mon Apr 2 03:49:42 2007 +0000
CommitDate: Mon Apr 2 03:49:42 2007 +0000

    Support enum data types.  Along the way, use macros for the values of
    pg_type.typtype whereever practical.  Tom Dunstan, with some kibitzing
    from Tom Lane.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Tom Smith
Дата:
Сообщение: Re: retrieve grouping sets/rollup rows
Следующее
От: James Keener
Дата:
Сообщение: Re: retrieve grouping sets/rollup rows