Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnkOs-0004oi-I9 for pgsql-hackers@arkaria.postgresql.org; Mon, 31 May 2021 16:04:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lnkOr-0001s8-Ho for pgsql-hackers@arkaria.postgresql.org; Mon, 31 May 2021 16:04:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnkOr-0001rx-5Q for pgsql-hackers@lists.postgresql.org; Mon, 31 May 2021 16:04:21 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lnkOp-0003RV-Ab for pgsql-hackers@lists.postgresql.org; Mon, 31 May 2021 16:04:20 +0000 Received: from mail.postgrespro.ru (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id BEB6D21C79B8 for ; Mon, 31 May 2021 19:04:17 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1622477057; bh=TIewtwJYB0jijF/1tn+EUGYitjbBtNo5fzmkmHlZTWM=; h=Date:From:To:Subject:In-Reply-To:References; b=DF3sxylwN5LdWKR1+M0X/HwFgsmv325UuBFYQeCFBayypqvNDzXL/JiM6dNgrL8uu Z193OGztw1ePcmeFKjqAcz4suFdwOOgCjvpUzeZPqbf1IXkuBriBUJQqNkiafoK6Bp givnmvwcsJVyIsWbIk6S3+0Wiy69sgiPly/KdSII= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 31 May 2021 19:04:17 +0300 From: Alexander Pyhalov To: PostgreSQL Hackers Subject: Re: join pushdown and issue with foreign update In-Reply-To: <7817fb9ebd6661cdf9b67dec6e129a78@postgrespro.ru> References: <7817fb9ebd6661cdf9b67dec6e129a78@postgrespro.ru> User-Agent: Roundcube Webmail/1.4.0 Message-ID: X-Sender: a.pyhalov@postgrespro.ru List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Pyhalov писал 2021-05-31 15:39: > Hi. > > There's issue with join pushdown after > > commit 86dc90056dfdbd9d1b891718d2e5614e3e432f35 > Author: Tom Lane > Date: Wed Mar 31 11:52:34 2021 -0400 > ... > You'll get > ERROR: input of anonymous composite types is not implemented > CONTEXT: whole-row reference to foreign table "remote_tbl" > > make_tuple_from_result_row() (called by fetch_more_data()), will try > to call InputFunctionCall() for ROW(r1.a, r1.b) and will get error in > record_in(). > > Here ROW(r2.a, r2.b) would have attribute type id, corresponding to > remote_tbl, but ROW(r1.a, r1.b) would have atttypid 2249 (RECORD). > The issue seems to be that add_row_identity_columns() adds RECORD var to the query. Adding var with table's relation type fixes this issue, but breaks update of partitioned tables, as we add "wholerow" with type of one child relation and then try to use it with another child (of different table type). -- Best regards, Alexander Pyhalov, Postgres Professional