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 1fp330-0003Dc-Fr for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Aug 2018 02:57:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fp32y-0007ic-AZ for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Aug 2018 02:57:32 +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 1fp32y-0007iV-1O for pgsql-hackers@lists.postgresql.org; Mon, 13 Aug 2018 02:57:32 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fp32u-00050R-FE for pgsql-hackers@postgresql.org; Mon, 13 Aug 2018 02:57:31 +0000 Received: by mail-lj1-x22d.google.com with SMTP id v9-v6so11378087ljk.4 for ; Sun, 12 Aug 2018 19:57:27 -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=omnSkfFSXpbfb1qlPxzaxiVq9k2/CMCjuAz4UqIYm5o=; b=tsbP1889L3DZ8FAD6WVCWEPedCAnItlAExdEzPkD5S0pPaNnUrAOPW21bkRF8X6mWV 4AzumWgX6Ee3ePeOEtM3yaJZ5P4KQ27odGGf3glcwyS4kAzPyJEwu2JAVxL6T4wisyJO iL8pszeiT8pe52ZWgRNa+SW+n8/8gisjYb37DmHq3Q6zYd/tWomNshaVf8EhVD0HH2Vk eokBzLdGas0sd9/ZidlRlcc402kjPNUhb0DoCwXd2TtCMpP4QDJlrWXK5xmyzwzsWhFy wYE7lfj/oXvVzaPOHKhojqq1jy0ZDz0PFCHBe/YJgN2IrgzIwoAedJmDgf+UHawj5+4c qdDw== 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=omnSkfFSXpbfb1qlPxzaxiVq9k2/CMCjuAz4UqIYm5o=; b=IT42UbJ5JMnwb0BTPjyJ7++1BNiU9OewECS1H0Fr8lwNoFup36C7K7C84fZ2p7lHpe jrPvOWWr69eLtfy/LBRMOWadyHlTB4sYKzI5jRs3VIfjP1DzkyDmz9OF79iT5B44oxS1 ITcjpKSIS/YOWSij5sP/V7WnpLK/MeU30VDKnsRr6ldLl4KI1zcO+MVQnniG3MKmCMQT RrDzBk1ILG9nmlObrYM8sgBwnWSWqBQgFNF2YyEZIv+Sj/Eyl0fTbnfFWGG7YFJC4nFV y84K+KrcxVPz7OcaiPg5IC8UmwM44HSxNVK7PfjSEmLP3f1MPdyGuvnl9euYkeNASQ5g aQdw== X-Gm-Message-State: AOUpUlFEWLaaBO6+TNNXP6DyJDm7qgokBHVtu8+n1WuqR7AYTGcIO/W5 WdiOlGg2cRVEvqR6uVWSHlQCg+iPsxMKCo5wQgo= X-Google-Smtp-Source: AA+uWPzwTqhUz+cxj2wujIOEPlLZ+KO3imWMXY3/FEFdTW+uyddYcHbmyLGarcllSz3KG1vI5IPMwqzDpM6CeTnJOJ4= X-Received: by 2002:a2e:1b83:: with SMTP id c3-v6mr10354724ljf.0.1534129047318; Sun, 12 Aug 2018 19:57:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:e508:0:0:0:0:0 with HTTP; Sun, 12 Aug 2018 19:57:25 -0700 (PDT) In-Reply-To: <5B683F60.2070806@lab.ntt.co.jp> References: <5AFC0865.8050802@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> <5B64562A.9000404@lab.ntt.co.jp> <5B645868.6030609@lab.ntt.co.jp> <5B683F60.2070806@lab.ntt.co.jp> From: Robert Haas Date: Sun, 12 Aug 2018 22:57:25 -0400 Message-ID: Subject: Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled. To: Etsuro Fujita Cc: Tom Lane , 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 Mon, Aug 6, 2018 at 8:30 AM, Etsuro Fujita wrote: > In the above I used the test whether the relation's reloptkind is > RELOPT_BASEREL or not, but I noticed that I had overlooked the case of a > multi-level partitioned table. So I fixed that and added regression test > cases for that. I also revised comments a bit. Attached is an updated > version of the patch. + /* If so, consider partitionwise joins for that join. */ + if (IS_PARTITIONED_REL(joinrel)) + joinrel->consider_partitionwise_join = true; Maybe this should assert that the inner and outer rels have consider_partitionwise_join set. There is an Assert quite a bit earlier in the function that the parent join have it set, but I think it might make sense to check the children have it set whenever we set the flag. Aside from that I don't really have any suggestions on this. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company