Re: Bug: Deferred FKey Check Happening on Double Update, Not Single - Mailing list pgsql-bugs

From Doug Safreno
Subject Re: Bug: Deferred FKey Check Happening on Double Update, Not Single
Date
Msg-id CAA=+orsauoKK_qit6kpe9TUYhUATkLQWFUPp2VOhEdN23p3+3g@mail.gmail.com
Whole thread Raw
In response to Re: Bug: Deferred FKey Check Happening on Double Update, Not Single  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-bugs
Gotcha, thanks for explanation.

Best,
Doug


On Fri, Feb 15, 2019 at 3:15 PM Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
>>>>> "Doug" == Doug Safreno <doug@avinetworks.com> writes:

 Doug> Hey Sergei,

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

The optimization that lets the check be skipped only applies on the
_first_ modification of the row within the transaction. On the second or
subsequent modifications, the code can't easily tell whether the row was
inserted in the current transaction (in which case the optimization must
be skipped) or just modified, so it assumes the worst.

--
Andrew (irc:RhodiumToad)

pgsql-bugs by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: Bug: Deferred FKey Check Happening on Double Update, Not Single
Next
From: Michael Paquier
Date:
Subject: Re: BUG #15631: Generated as identity field in a temporary tablewith on commit drop corrupts system catalogs