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 1flaqR-0004wY-6m for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Aug 2018 14:14:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flaqO-0006ew-3n for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Aug 2018 14:14:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flaqN-0006ep-Nf for pgsql-hackers@lists.postgresql.org; Fri, 03 Aug 2018 14:14:15 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1flaqG-0000cp-9Y for pgsql-hackers@postgresql.org; Fri, 03 Aug 2018 14:14:14 +0000 Received: by mail-lf1-x142.google.com with SMTP id g6-v6so4149927lfb.11 for ; Fri, 03 Aug 2018 07:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=B+02y1YCBKqr0DfkOfYWTiOqHd6NdC5vw8H/zr5Nh4o=; b=VDv4+khh5OjdDMV3LvCxmk9qJ/zxLcfI6qeu7i3cQz0WOF4y0SYo6eXCmykvpH2olG LFkHGa6Wp9LnT1QikXWkt6xNPhIojlF0V5Yeg1TSpBJEuKD/zCnKEC3dgT4NLD2T0HM9 cOYk52q2CtWWBh3f7atUB+PyV0GexrsHZSt1kX3eM+OqmzDQ5dXjS9f5isGdPEXD2u6X Hm3YyOwZvvMjgHIfRywFTrihsev7ht4lUD6jtnCDKBV4csAPa5mmQGwjZM7e0//lQXzw a5RXNODzO1lv1o2xfOx/KO7dYP43wPRq3RUG6FfDCSpbBWlXTI0wFEej9+HwfFefgaRg 2U4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=B+02y1YCBKqr0DfkOfYWTiOqHd6NdC5vw8H/zr5Nh4o=; b=pjqkmArNZvklGoFZ3cmmih37nfN9vIq4xrosxTHWKVGU+tC52HXZawwdiiM7y+9GVg e5zILsmMvZRfxsOReygr+/d1DpP7vdc8N4LSnMaW+tC3njri868+lgb1cZi5oaMiWuKe NnonNyzeJpWNp8ySncDHMLjb0Wjsav5RW4xqDtgdVxXLwpFzN7XGOKscc2kDsGSUqoSV WmgqSEqonnv+XCW7BNB3T0XDzTIdXey4+2IR5Zz0bAAofTm26znID4TKpI7+2XZliMpV 0TRxH/LIFxeB2hWxBWKLYlUZtMFAlPf0kmRznYFJ1erRTLchk90SY8HPCEhA31/i2ZFl R83g== X-Gm-Message-State: AOUpUlG6tuBypxbid1em0MbSQ3WIWKotTM/n2G+Z0CbnHppTt9IV+zsK iCjcJyZixLCuCs5nO1gCQV2QA4/5f7rVm36Yrhw= X-Google-Smtp-Source: AAOMgpca0swJQHI/FeWP9i30HqbRSXPvcqbJnTc8gt0vokS0DsRe7Il89pU+LnbOYVNUT7cHlam3vvmNTIN9cABiRyE= X-Received: by 2002:a19:8f10:: with SMTP id r16-v6mr4687204lfd.92.1533305645912; Fri, 03 Aug 2018 07:14:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:e508:0:0:0:0:0 with HTTP; Fri, 3 Aug 2018 07:14:04 -0700 (PDT) In-Reply-To: <12308.1533305221@sss.pgh.pa.us> 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> <12308.1533305221@sss.pgh.pa.us> From: Robert Haas Date: Fri, 3 Aug 2018 10:14:04 -0400 Message-ID: Subject: Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled. To: Tom Lane Cc: Etsuro Fujita , Andres Freund , Ashutosh Bapat , Rajkumar Raghuwanshi , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Aug 3, 2018 at 10:07 AM, Tom Lane wrote: > 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. I might be missing something, but the original reproducer involves a FOR UPDATE clause, and the expected regression test output in postgres_fdw.out appears to show a whole-row var in the foreign scan's target list only in those examples where a locking clause is present. >> 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. You're hard to please. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company