Re: Pulling data from a constraint def

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Pulling data from a constraint def
Дата
Msg-id 1273812061-sup-5195@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Pulling data from a constraint def  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Excerpts from Tom Lane's message of vie may 14 00:32:12 -0400 2010:
> Josh Kupershmidt <schmiddy@gmail.com> writes:
> > On Thu, May 13, 2010 at 8:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> Well, the inability to change the list of values is certainly an
> >> unpleasant limitation, but is it so fatal that we should hide the
> >> feature from people who could possibly use it? \xa0I think not.
>
> > I happened upon this article relevant to the subject after googling a bit:
> > http://www.justatheory.com/computers/databases/postgresql/enforce-set-of-values.html
>
> > One of the comments suggests adding an entry to pg_enum to expand the
> > legal values of an existing ENUM type. How safe is this idea?
>
> The trick is for the OID of the added entry to sort in the position you
> want it relative to the existing entries.  If you don't care about that,
> it's fine.

I was going to mention manual tweaking of the catalogs before Josh did,
but I realized that it's pretty likely that all the OIDs that the enum
pick are consecutive, and thus it's going to be very hard to insert
values in the middle of their sequence.  However it's easy to add a
new enum value that sorts before all the existing ones or after all of
them.
--

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Documentation availability as a single page of text
Следующее
От: Catalin BOIE
Дата:
Сообщение: PANIC: corrupted item pointer: 32766