Re: inherit support for foreign tables

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: hlinnakangas(at)vmware(dot)com, noah(at)leadboat(dot)com, shigeru(dot)hanada(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: inherit support for foreign tables
Date: 2014-11-07 12:01:38
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/11/07 14:57), Kyotaro HORIGUCHI wrote:
>>>> Here are separated patches.
>>>> fdw-chk.patch - CHECK constraints on foreign tables
>>>> fdw-inh.patch - table inheritance with foreign tables
>>>> The latter has been created on top of [1].
>>>> [1]
>>> To be exact, it has been created on top of [1] and fdw-chk.patch.
> I tried both patches on the current head, the newly added
> parameter to analyze_rel() hampered them from applying but it is
> easy to fix seemingly and almost all the other part was applied
> cleanly.

Thanks for the review!

> By the way, are these the result of simply splitting of your last
> patch, foreign_inherit-v15.patch?

The answer is "no".

> The result of apllying whole-in-one version and this splitted
> version seem to have many differences. Did you added even other
> changes? Or do I understand this patch wrongly?

As I said before, I splitted the whole-in-one version into three: 1)
CHECK constraint patch (ie fdw-chk.patch), 2) table inheritance patch
(ie fdw-inh.patch) and 3) path reparameterization patch (not posted).
In addition to that, I slightly modified #1 and #2.

IIUC, #3 would be useful not only for the inheritance cases but for
union all cases. So, I plan to propose it independently in the next CF.

>>> I noticed that the latter disallows TRUNCATE on inheritance trees that
>>> contain at least one child foreign table. But I think it would be
>>> better to allow it, with the semantics that we quietly ignore the
>>> child
>>> foreign tables and apply the operation to the child plain tables,
>>> which
>>> is the same semantics as ALTER COLUMN SET STORAGE on such inheritance
>>> trees. Comments welcome.
>> Done. And I've also a bit revised regression tests for both
>> patches. Patches attached.

I rebased the patches to the latest head. Here are updated patches.

Other changes:

* fdw-chk-3.patch: the updated patch revises some ereport messages a
little bit.

* fdw-inh-3.patch: I noticed that there is a doc bug in the previous
patch. The updated patch fixes that, adds a bit more docs, and revises
regression tests in foreign_data.sql a bit further.


Best regards,
Etsuro Fujita

Attachment Content-Type Size
fdw-inh-3.patch text/x-patch 90.6 KB
fdw-chk-3.patch text/x-patch 25.1 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Katharina Büchse 2014-11-07 12:19:22 Re: two dimensional statistics in Postgres
Previous Message Andreas Karlsson 2014-11-07 10:47:11 Re: Tweaking Foreign Keys for larger tables