Re: [HACKERS] Add support for tuple routing to foreign partitions

Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>

From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, Stephen Frost <sfrost@snowman.net>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Maksim Milyutin <milyutinma@gmail.com>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2018-02-26T11:50:31Z
Lists: pgsql-hackers
(2018/02/23 16:38), Amit Langote wrote:
> On Thu, Feb 22, 2018 at 8:49 PM, Etsuro Fujita
> <fujita.etsuro@lab.ntt.co.jp>  wrote:
>> This would introduce an asymmetry (we can move tuples from plain partitions
>> to foreign partitions, but the reverse is not true), but I am thinking that
>> it would be probably okay to document about that.

> About just documenting the asymmetry you mentioned that's caused by
> the fact that we don't enforce constraints on foreign tables, I
> started wondering if we shouldn't change our stance on the matter wrt
> "partition" constraints?

I'm not sure that it's a good idea to make an exception in that case. 
Another concern is triggers on the remote side; those might change the 
row so that the partition constraint of the containing partition is no 
longer satisfied.

> But, admittedly, that's a topic for a
> different thread.

OK, I'll leave that for another patch.

Will post a new version.  Thanks for the comments!

Best regards,
Etsuro Fujita


Commits

  1. Allow insert and update tuple routing and COPY for foreign tables.

  2. Refactor PgFdwModifyState creation/destruction into separate functions.