Re: Bug: Deferred FKey Check Happening on Double Update, Not Single

Поиск
Список
Период
Сортировка
От Doug Safreno
Тема Re: Bug: Deferred FKey Check Happening on Double Update, Not Single
Дата
Msg-id CAA=+orv3dihLAEp7f49o-kHkiJ6d=yTknjuk0RgLPbrtxYMFdw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Bug: Deferred FKey Check Happening on Double Update, Not Single  (Sergei Kornilov <sk@zsrv.org>)
Ответы Re: Bug: Deferred FKey Check Happening on Double Update, Not Single  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-bugs
Hey Sergei,

Neither transaction touches FK fields - so shouldn't they both skip FK trigger check?

Best,
Doug


On Thu, Feb 14, 2019 at 11:42 PM Sergei Kornilov <sk@zsrv.org> wrote:
Hi

> Which one is expected?

Both are expected. This is foreign key check optimisation: we can safely skip FK trigger check if row was inserted not in this transaction and update does not touch FK fields: https://github.com/postgres/postgres/blob/REL_11_STABLE/src/backend/utils/adt/ri_triggers.c#L1769

> And is this really a bug?

so no, this is not bug.

regards, Sergei

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #15631: Generated as identity field in a temporary table withon commit drop corrupts system catalogs
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: Bug: Deferred FKey Check Happening on Double Update, Not Single