Re: WIP: extensible enums

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: WIP: extensible enums
Дата
Msg-id AANLkTikNDvyC-Mdu1CjPcx2LXPFy_USomv2kTmHqp+7=@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: extensible enums  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, Oct 17, 2010 at 12:17 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>        begin;
>        alter type myenum add 'some-value';
>        insert into mytab values('some-value');
>        rollback;
....
> I think what this says is that we cannot allow any manipulations that
> involve an uncommitted enum value.  Probably the easiest way is to make
> the ALTER TYPE operation disallowed-inside-transaction-block.  That's
> pretty ugly, but doesn't seem like a serious restriction in practice
> (though for example it'd mean we couldn't use it in pg_dump).

I fear this is the camel's nose under the door towards making all DDL
non-transactional a la Oracle.

The alternative is that there are two steps to creating an enum. A
low-level modification which adds the new value and its collation
value to the list of valid things to compare. This would be done as
something like an autonomous transaction and be committed regardless
of whether the outer transaction commits. It wouldn't add the value to
the user-visible list of values or allowable values for inserting.
Only once that was committed could we then make the transactional
modification to the user visible DDL.

The main problem with this is of course that we don't actually have
autonomous transactions...


--
greg


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Floating-point timestamps versus Range Types
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Floating-point timestamps versus Range Types