Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flajb-0004e1-Fi for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Aug 2018 14:07:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flajZ-0004VL-Kl for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Aug 2018 14:07:13 +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 1flajZ-0004VE-Dw for pgsql-hackers@lists.postgresql.org; Fri, 03 Aug 2018 14:07:13 +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.89) (envelope-from ) id 1flajW-00066x-S6 for pgsql-hackers@postgresql.org; Fri, 03 Aug 2018 14:07:13 +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 w73E71a2012309; Fri, 3 Aug 2018 10:07:01 -0400 From: Tom Lane To: Robert Haas cc: Etsuro Fujita , Andres Freund , Ashutosh Bapat , Rajkumar Raghuwanshi , pgsql-hackers Subject: Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled. In-reply-to: References: <5AFC0865.8050802@lab.ntt.co.jp> <5AFD6580.5090308@lab.ntt.co.jp> <5AFE81CC.8000508@lab.ntt.co.jp> <5B17C5EC.1090602@lab.ntt.co.jp> <5B1E5071.1000704@lab.ntt.co.jp> <5B23A964.9020800@lab.ntt.co.jp> <5B28FB19.3090809@lab.ntt.co.jp> <20180703163519.tsigyic5xefunv74@alap3.anarazel.de> <5B3C2A4E.5030901@lab.ntt.co.jp> <5B4F2BE9.3000304@lab.ntt.co.jp> <5B55886F.5090906@lab.ntt.co.jp> <5B5712C8.9030404@lab.ntt.co.jp> <5B59BA55.30200@lab.ntt.co.jp> <5B619D23.4010000@lab.ntt.co.jp> <5358.1533241519@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Fri, 03 Aug 2018 09:44:52 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12307.1533305221.1@sss.pgh.pa.us> Date: Fri, 03 Aug 2018 10:07:01 -0400 Message-ID: <12308.1533305221@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Thu, Aug 2, 2018 at 4:25 PM, Tom Lane wrote: >> Now, that's a bit of a problem for postgres_fdw, because it seems to >> insist on injecting WRVs even when the query text does not require any. >> Why is that, and can't we get rid of it? > I don't quite know what you mean here -- postgres_fdw does use > whole-row vars for EPQ handling, which may be what you're thinking > about. As far as I can see from the example that started this thread, postgres_fdw injects WRVs into a PWJ whether or not the query involves FOR UPDATE; that's why this bug is reproducible in a query without FOR UPDATE. But we shouldn't need any EPQ support in that case. > Honestly, I'm pretty impressed that we have added not one but two > members to the RelOptKind enum without as little collateral damage as > there has been. Color me a bit more skeptical about the bug density in that, given that enable_partitionwise_join is off by default; that means you're not getting a lot of testing. regards, tom lane