Re: set-level update fails with unique constraint violation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: set-level update fails with unique constraint violation
Дата
Msg-id 2198.1262790891@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: set-level update fails with unique constraint violation  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: set-level update fails with unique constraint violation
Список pgsql-general
"Daniel Verite" <daniel@manitou-mail.org> writes:
> But still I wonder why there is that difference in behavior between NON
> DEFERRABLE and DEFERRABLE INITIALLY IMMEDIATE, when the unique constraint
> doesn't get deferred by using SET CONSTRAINTS.
> In the first case, we get the "after each row" behavior with the pk=pk+1
> failure, as with the previous PG versions.
> In the second case, we get the "after each statement" behavior which I
> believe complies with the standard, contrary to the first case, and
> successfully achieves the pk=pk+1 update as expected.
> Personally, I would have imagined that behavior #1 would be removed once
> behavior #2 was implemented, not that the two would co-exist. Is there a
> reason to keep #1?

1. Performance.  The cost of #2 is very large, and the number of cases
where you actually need it is not.

2. Backwards compatibility.  Some apps might be depending on the details
of the behavior.

            regards, tom lane

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

Предыдущее
От: Andy Colson
Дата:
Сообщение: Re: using a function
Следующее
От: Seb
Дата:
Сообщение: Re: conditional rule not applied