Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a73Vz-0005Ke-5a for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Dec 2015 15:52:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a73Vy-0006ED-OF for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Dec 2015 15:52:18 +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) (envelope-from ) id 1a73VM-0005Xk-UY for pgsql-bugs@postgresql.org; Thu, 10 Dec 2015 15:51:40 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1a73VK-0003VO-NQ for pgsql-bugs@postgresql.org; Thu, 10 Dec 2015 15:51:40 +0000 Received: from intern.anarazel.de (ns1.anarazel.de [217.115.131.41]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id D49D9860002; Thu, 10 Dec 2015 16:51:37 +0100 (CET) Date: Thu, 10 Dec 2015 16:51:36 +0100 From: Andres Freund To: Stanislav Grozev , Peter Geoghegan Cc: pgsql-bugs@postgresql.org Subject: Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement. Message-ID: <20151210155136.GC2551@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi, On 2015-11-30 11:43:12 +0000, Stanislav Grozev wrote: > I'd like to report a bug in the UPDATE trigger invocation when using the > new INSERT ON CONFLICT UPDATE (UPSERT) functionality. > > In short, if an UPDATE trigger is invoked by the ON CONFLICT DO UPDATE > clause of an UPSERT statement - it receives the new values in both the OLD > and NEW variables. Whereas if invoked by a normal UPDATE statement - it > correctly gets the respective values in OLD and NEW. I've pushed a fix for this. Thanks for the report! - Andres -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs