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

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: Doug Safreno <doug(at)avinetworks(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Cc: Gregory Cox <gcox(at)avinetworks(dot)com>, Sambit Das <sambit(dot)das(at)avinetworks(dot)com>, Vivek Kalyanaraman <vivek(at)avinetworks(dot)com>, Anand Parthasarathy <anpartha(at)avinetworks(dot)com>
Subject: Re: Bug: Deferred FKey Check Happening on Double Update, Not Single
Date: 2019-02-15 07:41:58
Message-ID: 2447821550216518@myt6-add70abb4f02.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Marc Schablewski 2019-02-15 12:15:10 Re: BUG #15637: Problem insert data 【Japanese】
Previous Message John Klann 2019-02-15 05:53:38 Re: BUG #15636: PostgreSQL 11.1 pg_basebackup backup to a CIFS destination throws fsync error at end of backup