Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fn6F1-0002GO-Cm for pgsql-docs@arkaria.postgresql.org; Tue, 07 Aug 2018 17:57:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fn6Ew-0002FK-UK for pgsql-docs@arkaria.postgresql.org; Tue, 07 Aug 2018 17:57:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fn6Ew-0002Eo-JW for pgsql-docs@lists.postgresql.org; Tue, 07 Aug 2018 17:57:50 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fn6Ep-00031D-9c for pgsql-docs@lists.postgresql.org; Tue, 07 Aug 2018 17:57:48 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1fn6Eo-0005Az-5z; Tue, 07 Aug 2018 13:57:42 -0400 Date: Tue, 7 Aug 2018 13:57:42 -0400 From: Bruce Momjian To: seb55@op.pl, pgsql-docs@lists.postgresql.org Subject: Re: RETURN NULL in the sample of insert trigger on partitioned table Message-ID: <20180807175742.GG7297@momjian.us> References: <153130169932.1401.6073393592184007233@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <153130169932.1401.6073393592184007233@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Jul 11, 2018 at 09:34:59AM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/9.6/static/ddl-partitioning.html > Description: > > Why in provided samples of "insert" triggers on partitioned table at the end > of the triggers you provide "return NULL" not "return NEW"? > > This causes, among other things, problems with the GET DIAGNOSTICS clause > var = ROW_COUNT clause. Uh, you mean measurement_insert_trigger? Returning NEW would cause the row to be inserted into the referenced table. -- 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 +