Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition) - Mailing list pgsql-hackers

From Amit Langote
Subject Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)
Date
Msg-id CA+HiwqHjA390+6WGD29cLS4Xmvj_VBSWnBsu_L0gfN-QyzWitw@mail.gmail.com
Whole thread Raw
In response to Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
On Tue, Apr 6, 2021 at 8:34 AM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> For now I have no objection to this feature.
>
> -IMPORT FOREIGN SCHEMA import_source EXCEPT (t1, "x 4", nonesuch)
> +IMPORT FOREIGN SCHEMA import_source EXCEPT (t1, "x 4", nonesuch, t4_part)
>
> Isn't it better to create also another partition like "t4_part2"?
> If we do this, for example, the above test can confirm that both
> partitions in EXCEPT and not in are excluded.
>
> +    All tables or foreign tables which are partitions of some other table
> +    are automatically excluded from <xref linkend="sql-importforeignschema"/>
> +    unless they are explicitly included in the <literal>LIMIT TO</literal>
>
> IMO it's better to document that partitions are imported when they are
> included in LIMIT TO, instead. What about the following?
>
>      Tables or foreign tables which are partitions of some other table are
>      imported only when they are explicitly specified in
>      <literal>LIMIT TO</literal> clause.  Otherwise they are automatically
>      excluded from <xref linkend="sql-importforeignschema"/>.
>
> +    clause.  Since all data can be accessed through the partitioned table
> +    which is the root of the partitioning hierarchy, this approach should
> +    allow access to all the data without creating extra objects.
>
> Now "this approach" in the above is not clear? What about replacing it with
> something like "importing only partitioned tables"?

+1, that wording is better.

-- 
Amit Langote
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)
Next
From: Amit Langote
Date:
Subject: Re: A reloption for partitioned tables - parallel_workers