Re: Deferred RI trigger for non-key UPDATEs and subxacts

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Deferred RI trigger for non-key UPDATEs and subxacts
Дата
Msg-id 87odicfwuf.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Deferred RI trigger for non-key UPDATEs and subxacts  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-patches
"Gregory Stark" <stark@enterprisedb.com> writes:

> On the other hand what happens if you have constraints not deferred, insert a
> record, then set constraints deferred and update it?

After having a coffee this is obviously not a problem since if you have
constraints not deferred then the constraint was checked immediately. We don't
have to do the constraint in that case even if the row was inserted by us but
that's an optimization that probably nobody cares about.

If you go the other direction from deferred to not deferred then the
constraint will be checked when you set the constraint to immediate so it's
safe to skip the constraint check if the keys match subsequently regardless of
whether we inserted the record.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


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

Предыдущее
От: NikhilS
Дата:
Сообщение: Re: CREATE TABLE LIKE INCLUDING INDEXES support
Следующее
От: Stefan Kaltenbrunner
Дата:
Сообщение: bogus unixware compiler warnings