Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnPRT-0005WZ-82 for pgsql-docs@arkaria.postgresql.org; Thu, 31 Aug 2017 13:23:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dnPRS-0000sO-R5 for pgsql-docs@arkaria.postgresql.org; Thu, 31 Aug 2017 13:23:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dnPRS-0000qY-8e for pgsql-docs@postgresql.org; Thu, 31 Aug 2017 13:23:30 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dnPRO-0005DE-DT for pgsql-docs@postgresql.org; Thu, 31 Aug 2017 13:23:29 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1dnPRM-0000F4-80; Thu, 31 Aug 2017 09:23:24 -0400 Date: Thu, 31 Aug 2017 09:23:24 -0400 From: Bruce Momjian To: neil@fairwindsoft.com Cc: pgsql-docs@postgresql.org Subject: Re: Confusing Trigger Docs. Message-ID: <20170831132324.GB2355@momjian.us> References: <20170703200710.27956.64565@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170703200710.27956.64565@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org Can someone help with this text? I think the author is right that it needs correction or clarification. --------------------------------------------------------------------------- On Mon, Jul 3, 2017 at 08:07:10PM +0000, neil@fairwindsoft.com wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/9.6/static/trigger-definition.html > Description: > > https://www.postgresql.org/docs/devel/static/trigger-definition.html > > This sentence: > > "If an INSERT contains an ON CONFLICT DO UPDATE clause, it is possible that > the effects of all row-level BEFORE INSERT triggers and all row-level BEFORE > UPDATE triggers can both be applied in a way that is apparent from the final > state of the updated row, if an EXCLUDED column is referenced." > > is very hard to digest. > > Should "is apparent" really be "is not apparent"? If not, what does "is > apparent" mean and why is this statement here? > > Then > > "There need not be an EXCLUDED column reference for both sets of row-level > BEFORE triggers to execute, though." > > Does this mean that both row level BEFORE INSERT and BEFORE UPDATE triggers > are always executed when ON CONFLICT DO UPDATE clause is present? Or is > there some circumstance where they are not? > > If so, does this also mean that if I have a single trigger defined as BEFORE > UPDATE OR INSERT that this trigger will fire twice? > > -- > Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-docs -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs