pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Doug Safreno <doug@avinetworks.com>
Cc: Sergei Kornilov <sk@zsrv.org>
Cc: pgsql-bugs\@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Cc: Gregory Cox <gcox@avinetworks.com>
Cc: Sambit Das <sambit.das@avinetworks.com>
Cc: Vivek Kalyanaraman <vivek@avinetworks.com>
Cc: Anand Parthasarathy <anpartha@avinetworks.com>
Cc: webapp-dev <webapp-dev@avinetworks.com>
Subject: Re: Bug: Deferred FKey Check Happening on Double Update, Not Single
Date: Fri, 15 Feb 2019 23:15:25 +0000
Message-ID: <87tvh4k5m5.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CAA=+orv3dihLAEp7f49o-kHkiJ6d=yTknjuk0RgLPbrtxYMFdw@mail.gmail.com>
References: <CAA=+ort6kOENg7asqzq9OQ6kH0x_S5NLzWD7C=rawYgKWb+YAw@mail.gmail.com>
	<2447821550216518@myt6-add70abb4f02.qloud-c.yandex.net>
	<CAA=+orv3dihLAEp7f49o-kHkiJ6d=yTknjuk0RgLPbrtxYMFdw@mail.gmail.com>

>>>>> "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)




view thread (5+ messages)  latest in thread

Message-ID: <87tvh4k5m5.fsf@news-spur.riddles.org.uk>
Permalink:  ../87tvh4k5m5.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87tvh4k5m5.fsf@news-spur.riddles.org.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, doug@avinetworks.com, sk@zsrv.org, gcox@avinetworks.com, sambit.das@avinetworks.com, vivek@avinetworks.com, anpartha@avinetworks.com, webapp-dev@avinetworks.com
  Subject: Re: Bug: Deferred FKey Check Happening on Double Update, Not Single
  In-Reply-To: <87tvh4k5m5.fsf@news-spur.riddles.org.uk>
  References: <CAA=+ort6kOENg7asqzq9OQ6kH0x_S5NLzWD7C=rawYgKWb+YAw@mail.gmail.com> <2447821550216518@myt6-add70abb4f02.qloud-c.yandex.net> <CAA=+orv3dihLAEp7f49o-kHkiJ6d=yTknjuk0RgLPbrtxYMFdw@mail.gmail.com> <87tvh4k5m5.fsf@news-spur.riddles.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox