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 1lo9Qz-0007IU-2z for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Jun 2021 18:48:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lo9Qv-0002V4-Qy for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Jun 2021 18:48:09 +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 1lo9Qv-0002Ss-GH for pgsql-hackers@lists.postgresql.org; Tue, 01 Jun 2021 18:48:09 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lo9Ql-0007pP-In for pgsql-hackers@lists.postgresql.org; Tue, 01 Jun 2021 18:48:09 +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 9A95221C05A9; Tue, 1 Jun 2021 21:47:58 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1622573278; bh=Hc/gWHEPHRBzhFWlzOwd9wQUT6lUARKbYqaE1FB05QA=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=LWuSF/66ulOHtbqmYUR46UrBEMori8Pq2bpUohET9XtlRNuuW7XrXPajk8/Dd1TGI x9Ac2QjHCpIr8S1yaeXmmVPw80XZ3pDspNZAj+2vbPeS6Jg1cPWEFJz2nxic72KQr7 HbwBKZR2r0pp2htJo39jxEOKFjh2GsxamkG9eMwY= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_57d7cec211eca762a76e646818001cb8" Content-Transfer-Encoding: 8bit Date: Tue, 01 Jun 2021 21:47:58 +0300 From: Alexander Pyhalov To: Tom Lane Cc: Amit Langote , PostgreSQL Hackers Subject: Re: join pushdown and issue with foreign update In-Reply-To: <2845636.1622571541@sss.pgh.pa.us> References: <7817fb9ebd6661cdf9b67dec6e129a78@postgrespro.ru> <050b90460c024dd21af53dbaaf8fd510@postgrespro.ru> <2845636.1622571541@sss.pgh.pa.us> 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 --=_57d7cec211eca762a76e646818001cb8 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed Tom Lane писал 2021-06-01 21:19: > Alexander Pyhalov writes: >> What about the following patch? > > ISTM that using a specific rowtype rather than RECORD would be > quite disastrous from the standpoint of bloating the number of > distinct resjunk columns we need for a partition tree with a > lot of children. Maybe we'll have to go that way, but it seems > like an absolute last resort. Why do you think they are distinct? In suggested patch all of them will have type of the common ancestor (root of the partition tree). > > I think a preferable fix involves making sure that the correct > record-type typmod is propagated to record_in in this context. > Alternatively, maybe we could insert the foreign table's rowtype > during execution of the input operation, without touching the > plan as such. > > Could we start by creating a test case that doesn't involve > uncommittable hacks to the source code? Yes, it seems the following works fine to reproduce the issue. -- Best regards, Alexander Pyhalov, Postgres Professional --=_57d7cec211eca762a76e646818001cb8 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=example.diff Content-Disposition: attachment; filename=example.diff; size=999 ZGlmZiAtLWdpdCBhL2NvbnRyaWIvcG9zdGdyZXNfZmR3L3NxbC9wb3N0Z3Jlc19mZHcuc3FsIGIv Y29udHJpYi9wb3N0Z3Jlc19mZHcvc3FsL3Bvc3RncmVzX2Zkdy5zcWwKaW5kZXggNzgzNzliZGVh NWIuLjRkYmI4MGMzZ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