Re: Clarification, please

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Clarification, please
Дата
Msg-id 17839.1291222747@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Clarification, please  (Mladen Gogala <mladen.gogala@vmsinfo.com>)
Ответы Re: Clarification, please  (Mladen Gogala <mladen.gogala@vmsinfo.com>)
Список pgsql-novice
Mladen Gogala <mladen.gogala@vmsinfo.com> writes:
> In Oracle, deferrable primary keys are enforced by non-unique indexes.
> That seems logical,

... maybe to an Oracle guy ...

> When the constraint is deferred in the transaction block, however, it
> tolerates duplicate values until the end of transaction:

Sure.  That's exactly per spec: the check is deferred to end of
transaction.  If the duplicated index entries are both/all still live
at that time, you get an error.

We do still execute the insertion-time uniqueness check, but instead of
throwing an error on failure, we just queue a trigger event to recheck
that key before commit.  If the insertion-time check passes then there's
no need for a recheck later.  This is a win because the insertion-time
check is cheap, being integrated into the insertion process itself.

            regards, tom lane

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

Предыдущее
От: Mladen Gogala
Дата:
Сообщение: Clarification, please
Следующее
От: Mladen Gogala
Дата:
Сообщение: Re: Clarification, please