Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctoLq-0003ZW-Fb for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Mar 2017 04:39:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ctoLq-00089z-2R for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Mar 2017 04:39:54 +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 1ctoKK-0003u1-37 for pgsql-hackers@postgresql.org; Fri, 31 Mar 2017 04:38:20 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctoKH-00068N-Mj for pgsql-hackers@postgresql.org; Fri, 31 Mar 2017 04:38:18 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id v2V4cEZt015514; Fri, 31 Mar 2017 13:38:14 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id D52675F623; Fri, 31 Mar 2017 13:38:14 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id C89385F58A; Fri, 31 Mar 2017 13:38:14 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTP id B719E400B21; Fri, 31 Mar 2017 13:38:14 +0900 (JST) Subject: Re: postgres_fdw IMPORT SCHEMA and partitioned tables References: <20170309141531.GD9812@tamriel.snowman.net> From: Amit Langote Message-ID: <2cab6db2-cf10-b8f2-58ed-7d4a052dac34@lab.ntt.co.jp> Date: Fri, 31 Mar 2017 13:37:55 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Michael Paquier , Robert Haas Cc: Stephen Frost , PostgreSQL mailing lists X-TM-AS-MML: disable X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2017/03/31 13:23, Michael Paquier wrote: > On Wed, Mar 29, 2017 at 12:30 PM, Michael Paquier > wrote: >> Users like things that are friendly, and we are most likely going to >> piss them off when using postgres_fdw if they need to list manually >> each parent table from the IMPORT FOREIGN SCHEMA command. >> >>> However, if we're going to do something about this, I think it should >>> be done soon. Otherwise, I'm going to advocate for reclassifying this >>> issue from "open item" to "possible area for future development". >> >> I was just waiting for the end of the CF before sending in a patch, >> allocating now some time to look at some patches pending for reviews. > > And here is the promised patch to address this open item. Looks good to me, except maybe: + + + For partitioned tables, partitions are automatically excluded from the + schema data imported. Only the definition of partitioned tables is included + to give access to the full data set of all partitions present remotely. + + Only the definitions of "root" partitioned tables, because when using multi-level partitioning, there would be partitioned tables that won't be included (because, relispartition=true). If you agree, then this code comment too could use the same terminology: + * Ignore table data for partitions and only include the parent + * definitions to allow access to the complete remote data set + * locally in the schema imported. + * Thanks, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers