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 1flJ8h-0005Hc-Mc for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Aug 2018 19:19:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flJ8f-00059H-2x for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Aug 2018 19:19:57 +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 1flJ8e-000596-Ll for pgsql-hackers@lists.postgresql.org; Thu, 02 Aug 2018 19:19:56 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1flJ8b-0000Us-R6 for pgsql-hackers@postgresql.org; Thu, 02 Aug 2018 19:19:55 +0000 Received: by mail-lf1-x141.google.com with SMTP id u202-v6so2341088lff.9 for ; Thu, 02 Aug 2018 12:19:53 -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=/V1rgv7ETRW/orrn0MMCzrMaI8kmJxSzpjzARt6Nx7o=; b=F6Pmq3Oj1nxCqwuXdzQdcM8+TeE8SpumszkfIY/0wXuoUVVLPQrqteoWhwXof+JINM i292Woyi209PN6qjgjZc1WEMNSTXt759HWN+kYWPo70c1okVq4XJwO1LULJPMwCEFxbT Jn1Q5ybQliw2jPR9ohLNhzsOrjc+T0iGh1CGjEI2mB1iADgfPMaOf0F7TwB3Xa6wEDkE /0xz+TFVa3ADuRQkzi4PMWEOiHh6ioGUMmeS6LEBVnFj0uN0spx/9Lc5HHRgEbc6TF+M gqNmlQ8OW9jwLD9cob+twS7tyoMz/kyhq5dU5DQ6UAq3MZrwPTUnwgvX+F/xzbiNQfLg hoIw== 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=/V1rgv7ETRW/orrn0MMCzrMaI8kmJxSzpjzARt6Nx7o=; b=BXupsgntkK7m2Q++nvf65Wf/AcN9Wt+2WRUDHbnO0yEqX6tkBIFBRiPm4I/17v9s9S ja3DbvxwHb2vK6tWvEuUNEzo2WDuR4q7WMDw7x2UUu/fiKyCgkwAMTR1afZfLgxDo4v+ PRsmdZ9erXfjmcqDeGmUOoKmCdA31Zg1cshvB7F+V8p/67n4ifph8C+TlI6A49Sr7MHm YwczBOzyOjGUjpTmFkwRuUhqTID4XEzuA1rUcu5vKheSmd9IhBjCioOe83A2njUMJr91 I3C/6M4Do3ES7jXDN6DoZM0mnFYbQSJJS6yOQcTFb/LOshb9YAE2E+fbtkko1MvH69lT 6+jw== X-Gm-Message-State: AOUpUlFBP1QJERNOV2EhXX7KrecwPtRQ6INp7eeRE2T4vp51qCzJnyQD sxZlR/O9QG0927bKj7imSVJnJ8fHyRinrHcebc0= X-Google-Smtp-Source: AAOMgpc0iayKAt2Z4sbQqQCwmCmg/4noDPMW52ftJEf7WpHPkQ1Al7NJK5XaXuu1QoosCMKEIDW4+ukM4pfsoqkfrSY= X-Received: by 2002:a19:a705:: with SMTP id q5-v6mr2790918lfe.148.1533237591024; Thu, 02 Aug 2018 12:19:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:e508:0:0:0:0:0 with HTTP; Thu, 2 Aug 2018 12:19:49 -0700 (PDT) In-Reply-To: <5B62E8E3.8060402@lab.ntt.co.jp> 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> <5B62E8E3.8060402@lab.ntt.co.jp> From: Robert Haas Date: Thu, 2 Aug 2018 15:19:49 -0400 Message-ID: Subject: Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled. To: Etsuro Fujita Cc: Andres Freund , Ashutosh Bapat , Rajkumar Raghuwanshi , pgsql-hackers , Tom Lane Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Aug 2, 2018 at 7:20 AM, Etsuro Fujita wrote: > The new approach seems to me more localized than what Ashutosh had proposed. > One obvious advantage of the new approach is that we no longer need changes > to postgres_fdw for it to work for partitionwise joins, which would apply > for any other FDWs, making the FDW authors' life easy. Well, I don't know what to say here expect that I don't agree. I think Ashutosh's approach is a pretty natural extension of the system that we have now. It involves needing to handle converted whole row vars in some new places, most of which were handled in the original patch, but postgres_fdw was missed. Your approach involves changing the meaning of the target list, but only in narrow corner cases. I completely disagree that we can say it's less invasive. It may indeed be less work for extension authors, though, though perhaps at the expense of moving the conversion from the remote server to the local one. >> But in general, with your approach, any code that >> looks at the tlist for a child-join has to know that the tlist is to >> be used as-is *except that* ConvertRowtypeExpr may need to be >> inserted. I think that special case could be easy to overlook, and it >> seems pretty arbitrary. > > I think we can check to see whether the conversion is needed, from the flags > added to RelOptInfo. Sure, I don't dispute that it can be made to work. I just think it's an ugly kludge. > I have to admit that it's weird to adjust the child's targetlist in that > case when putting the child under the parent's Append/MergeAppend, but IMHO > I think that would be much localized. Yeah, I just don't agree at all. Does anyone else want to weigh in on this? It seems to me that there are several people who are quite willing to complain about the fact that this hasn't been fixed, but not willing to express an opinion about the shape of the fix. Either the RMT needs to take executive action, or we need some more votes. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company