Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1NFj-0002B8-70 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Mar 2019 03:29:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1NFh-0008Bh-U3 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Mar 2019 03:29:53 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1NFh-0008Ba-MA for pgsql-hackers@lists.postgresql.org; Wed, 06 Mar 2019 03:29:53 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1NFc-0007OA-PM for pgsql-hackers@lists.postgresql.org; Wed, 06 Mar 2019 03:29:53 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x263Th6C015058; Wed, 6 Mar 2019 12:29:43 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 5D01563878C; Wed, 6 Mar 2019 12:29:43 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 51726638733; Wed, 6 Mar 2019 12:29:43 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 2402E400397; Wed, 6 Mar 2019 12:29:43 +0900 (JST) Message-ID: <5C7F3E94.2060101@lab.ntt.co.jp> Date: Wed, 06 Mar 2019 12:29:24 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 Subject: Re: Update does not move row across foreign partitions in v11 References: <20190227193114.GA19279@alvherre.pgsql> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: David Rowley Cc: PostgreSQL Hackers , Robert Haas , Alvaro Herrera , Derek Hans X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk (2019/03/06 11:06), David Rowley wrote: > On Tue, 5 Mar 2019 at 03:01, Derek Hans wrote: >> Based on a reply to reporting this as a bug, moving rows out of foreign partitions is not yet implemented so this is behaving as expected. There's a mention of this limitation in the Notes section of the Update docs. > > (Moving this discussion to -Hackers) > > In [1], Derek reports that once a row is inserted into a foreign > partition that an UPDATE does not correctly route it back out into the > correct partition. > > I didn't really follow the foreign partition code when it went in, but > do recall being involved in the documentation about the limitations of > partitioned tables in table 5.10.2.3 in [2]. Unfortunately, table > 5.10.2.3 does not seem to mention this limitation at all. As Derek > mentions, there is a brief mention in [3] in the form of: > > "Currently, rows cannot be moved from a partition that is a foreign > table to some other partition, but they can be moved into a foreign > table if the foreign data wrapper supports it." > > I don't quite understand what a "foreign table to some other > partition" is meant to mean. Partitions don't have foreign tables, > they can only be one themselves. I think "foreign table" is describing "partition" in front of that; "a partition that is a foreign table". > I've tried to put all this right again in the attached. However, I was > a bit unsure of what "but they can be moved into a foreign table if > the foreign data wrapper supports it." is referring to. Copying Robert > and Etsuro as this was all added in 3d956d9562aa. Hopefully, they can > confirm what is meant by this. That means that rows can be moved from a local partition to a foreign partition if the FDW supports it. IMO, I think the existing mention in [3] is good, so I would vote for putting the same mention in table 5.10.2.3 in [2] as well. Best regards, Etsuro Fujita