Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1db3tR-0007nz-SH for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Jul 2017 11:57:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1db3tQ-0005sn-KV for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Jul 2017 11:57:20 +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.84_2) (envelope-from ) id 1db3tQ-0005sa-2E; Fri, 28 Jul 2017 11:57:20 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1db3tH-0002EU-U3; Fri, 28 Jul 2017 11:57:18 +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 v6SBv6Yv028950; Fri, 28 Jul 2017 20:57:06 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 55A3B5F63F; Fri, 28 Jul 2017 20:57:06 +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 48AF55F593; Fri, 28 Jul 2017 20:57:06 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 3F60B400C27; Fri, 28 Jul 2017 20:57:06 +0900 (JST) Subject: Re: [HACKERS] BUG #14759: insert into foreign data partitions fail References: <20170724212815.1456.54156@wrigleys.postgresql.org> <7a8c22cd-3330-753b-1c3a-e95f64908179@lab.ntt.co.jp> From: Etsuro Fujita Message-ID: <10992ef4-2735-90e9-cd31-97d4db3657f4@lab.ntt.co.jp> Date: Fri, 28 Jul 2017 20:55:30 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit To: Amit Langote , "David G. Johnston" Cc: mtuncer@gmail.com, "pgsql-bugs@postgresql.org" , Pg Hackers X-TM-AS-MML: disable List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2017/07/26 15:29, Amit Langote wrote: > On 2017/07/25 9:43, David G. Johnston wrote: >> On Mon, Jul 24, 2017 at 5:19 PM, Amit Langote >> wrote: >>> On 2017/07/25 6:28, mtuncer@gmail.com wrote: >>>> The following bug has been logged on the website: >>>> >>>> Bug reference: 14759 >>>> Logged by: Murat Tuncer >>>> Email address: mtuncer@gmail.com >>>> PostgreSQL version: 10beta2 >>>> Operating system: Mac 10.12.6 >>>> Description: >>>> >>>> I got >>>> >>>> ERROR: cannot route inserted tuples to a foreign table >>> >>> Inserting tuples into a partitioned table that will route to one of its >>> foreign table partitions is unsupported in PG 10. The limitation is >>> mentioned on the following page: >>> https://www.postgresql.org/docs/devel/static/ddl-partitioning.html >> It would be nice to also note this limitation here: >> >> https://www.postgresql.org/docs/devel/static/sql-createforeigntable.html > > Yeah, I thought the same when writing my previous email. > >> Also, the ddl-partitioning.html page has a section "5.10.2.3. >> Limitations". Moving (or duplicating maybe) the existing comment on that >> page in that section would make finding out about this limitation a bit >> easier. > > Yeah, perhaps. > >> I'd probably move (and rework) the "limitation wording" to the limitation >> sections and do something like the following in the main section. >> >> "Foreign Tables can be added to a partitioning structure but inserts to the >> partitioned table will fail if they are routed to a foreign table >> partition. Direct writes to the foreign table, and partition reads, work >> normally." > > Done that in the attached. > >> I'm curious what the other limitations are... I think COPY has the same limitation as INSERT. > When I first wrote that documentation line (I am assuming you're asking > about "although these have some limitations that normal tables do not"), I > was thinking about the fact that the core system does not enforce > (locally) any constraints defined on foreign tables. Since we allow > inserting data into partitions directly, it is imperative that we enforce > the "partition constraint" along with the traditional constraints such as > NOT NULL and CHECK constraints, which we can do for local table partitions > but not for foreign table ones. > > Anyway, attached patch documents all these limitations about foreign table > partitions more prominently. Typo: s/the they is/they are/ Best regards, Etsuro Fujita -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs