Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsCvQ-0005BT-AU for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Oct 2016 17:57:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bsCvP-0002En-NN for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Oct 2016 17:57:43 +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 1bsCul-0000nx-AR for pgsql-bugs@postgresql.org; Thu, 06 Oct 2016 17:57:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bsCui-0003C2-RI for pgsql-bugs@postgresql.org; Thu, 06 Oct 2016 17:57:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u96Huuia027412; Thu, 6 Oct 2016 13:56:56 -0400 From: Tom Lane To: Marco Colombo cc: David Fetter , pgsql-bugs@postgresql.org Subject: Re: BUG #14351: Upsert not working in case of partitioned tables In-reply-to: References: <20161003142100.27241.67538@wrigleys.postgresql.org> <20161003200826.GA11863@fetter.org> Comments: In-reply-to Marco Colombo message dated "Thu, 06 Oct 2016 13:43:14 +0200" Date: Thu, 06 Oct 2016 13:56:56 -0400 Message-ID: <27411.1475776616@sss.pgh.pa.us> X-Pg-Spam-Score: -4.5 (----) 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 Marco Colombo writes: > Hi, are information provided sufficient to reproduce the problem? I think you're hoping for a feature that doesn't exist, and is unlikely to do so anytime soon. The INSERT ... ON CONFLICT clause describes what to do in case the unique constraint on table dh_1 is violated. But it isn't, since indeed no insert into dh_1 happens at all. Some other constraint on some other table is being violated. The fact that that other insert is being driven from an ON-INSERT trigger belonging to dh_1 isn't enough to make a connection --- after all, that trigger could do anything at all. If we had a true partitioning feature where the connection between the table insertions was hardwired into the system (rather than emerging from user-written triggers) and the partitions were all guaranteed to have identical unique constraints, then it would be reasonable to expect INSERT ... ON CONFLICT to handle conflicts within the partitions. But we're still some ways away from having that. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs