Re: 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: Maksim Milyutin <milyutinma@gmail.com>, Robert Haas <robertmhaas@gmail.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Date: 2017-10-27T11:00:38Z
Lists: pgsql-hackers

Attachments

On 2017/10/26 16:40, Etsuro Fujita wrote:
> Other changes I made 
> to the executor are: (1) currently, we set the RT index for the root 
> partitioned table to ri_RangeTableIndex of partitions' ResultRelInfos, 
> but the proposed EXPLAIN requires that the partition's 
> ri_RangeTableIndex is set to the RT index for that partition's RTE, to 
> show that partition info in the output.  So, I made that change.

One thing I forgot to mention is: that would be also required to call 
BeginForeignModify, ExecForeignInsert, and EndForeignModify with the 
partition's ResultRelInfo.

I updated docs in doc/src/sgml/ddl.sgml the same way as [1].  (I used 
only the ddl.sgml change proposed by [1], not all the changes.)  I did 
some cleanup as well.  Please find attached an updated version of the patch.

Best regards,
Etsuro Fujita

[1] 
https://www.postgresql.org/message-id/b19a8e2b-e000-f592-3e0b-3e90ba0fa816%40lab.ntt.co.jp

Commits

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

  2. Refactor PgFdwModifyState creation/destruction into separate functions.