Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9FQ4-0006RU-4l for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Apr 2018 19:40:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f9FQ2-0004nk-CT for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Apr 2018 19:40:34 +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.89) (envelope-from ) id 1f9FQ1-0004na-Dr for pgsql-hackers@lists.postgresql.org; Thu, 19 Apr 2018 19:40:34 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9FPr-0001D3-86 for pgsql-hackers@postgresql.org; Thu, 19 Apr 2018 19:40:32 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id BC31A115D; Thu, 19 Apr 2018 15:40:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 19 Apr 2018 15:40:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=pX1u9+gvDzRfyfNA5 yF/vTLardBf0LZsIvgz8azEWKA=; b=FUMjMRHIXhgpYqCAPm11cv/oO/XKGpyk1 OoPFeTDmYBMryzB9GBgoOFr3bz90bo/RZWKJU6cbIBTpUZDbKWtH5nuVQ4Y15mxJ SrMSqOjYKrITwi3Ll3TYwhJOxgw5frVU2gFucH7PE6H3atSv6Ji9vp5CXxbBzIX4 RtkKF0HaBvk7AQKjJKNBtFZYhELDMKxgbdvHMkWKkyqlTgF5G6+Uq9lpzZ9x5B8o zXG81a+8KB2scM8xQgoAXKe30lpWcrhRExz/wvMiw/3uZIgWxU5aEgZ53rA3wVf5 QNf7cmrXAaiB8Liu2QjTN4hNyTWXAVGACnEgIG4neG/9kA9G1KBHQ== X-ME-Sender: Received: from alvin.alvh.no-ip.org (unknown [179.56.29.253]) by mail.messagingengine.com (Postfix) with ESMTPA id C9EDAE44D5; Thu, 19 Apr 2018 15:40:19 -0400 (EDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 6FC6F536; Thu, 19 Apr 2018 16:40:17 -0300 (-03) Date: Thu, 19 Apr 2018 16:40:17 -0300 From: Alvaro Herrera To: Amit Langote Cc: Pavan Deolasee , Etsuro Fujita , Andres Freund , Pg Hackers , Peter Geoghegan Subject: Re: ON CONFLICT DO UPDATE for partitioned tables Message-ID: <20180419194017.xeqvcndqsslojqk2@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180419172054.3ei6gf55kuu2ofyk@alvherre.pgsql> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera wrote: > Amit Langote wrote: > > > Yeah, I too have wondered in the past what it would take to make > > equalTupDescs() return true for parent and partitions. Maybe we can make > > it work by looking a bit harder than I did then. > > How about simply relaxing the tdtypeid test from equalTupleDescs? I > haven't looked deeply but I think just checking whether or not both are > RECORDOID might be sufficient, for typecache purposes. After looking at the code, I'm a bit nervous about doing this, because I don't fully understand what is going on in typcache, and what is the HeapTupleHeaderGetTypeId macro really doing. I'm afraid that if we confuse a table's tupdesc with one of its partition's , something entirely random might end up happening. Maybe this is completely off-base, but if so I'd like to have to proof. So I'm thinking of reverting that patch instead per your patch. While composing this we got emails from Robert and Peter G suggesting the same too, so consider it done. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services