From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Derek Hans <derek.hans@gmail.com>
Subject: Re: Update does not move row across foreign partitions in v11
Date: Wed, 06 Mar 2019 15:16:25 +0900
Message-ID: <5C7F65B9.9050804@lab.ntt.co.jp> (raw)
In-Reply-To: <dcd27055-2d46-0990-60fc-5344b9232365@lab.ntt.co.jp>
References: <CAGrP7a3Xc1Qy_B2WJcgAD8uQTS_NDcJn06O5mtS_Ne1nYhBsyw@mail.gmail.com>
<20190227193114.GA19279@alvherre.pgsql>
<CAGrP7a0VhvM23m_kSsXUc1iAj4Z5DkyBaqq=fhxAS8VxNaFZ5w@mail.gmail.com>
<CAKJS1f-kwK71B8TV7tbe5dpbhVvR-7J5TqHCiQkw8pbwdwD-dw@mail.gmail.com>
<5C7F3E94.2060101@lab.ntt.co.jp>
<CAKJS1f-SauQJftjcaQ7C_tzHh_be5C8shT-E9qYnVp+jh4-Fww@mail.gmail.com>
<2396e176-ede8-cfbc-d012-fdb7a7e8b1f0@lab.ntt.co.jp>
<CAKJS1f81JuXMv+Ay8Nbfisgi+76Y2f9PO-jVw_J5-E_KpBN_Mg@mail.gmail.com>
<dcd27055-2d46-0990-60fc-5344b9232365@lab.ntt.co.jp>
(2019/03/06 13:53), Amit Langote wrote:
> On 2019/03/06 13:30, David Rowley wrote:
>> I think you missed my point. If there's no special support for "tuple
>> moving", as you say, then what help is it to tell the user "if the FDW
>> supports tuple routing"? The answer is, it's not any help. How would
>> the user check such a fact?
>
> Hmm, maybe getting the following error, like one would get in PG 10 when
> using postgres_fdw-managed partitions:
>
> ERROR: cannot route inserted tuples to a foreign table
>
> Getting the above error is perhaps not the best way for a user to learn of
> this fact, but maybe we (and hopefully other FDW authors) mention this in
> the documentation?
+1
>> As far as I can tell, this is just the requirements as defined in
>> CheckValidResultRel() for CMD_INSERT. Fragments of which I pasted
>> above.
>
> Only supporting INSERT doesn't suffice though. An FDW which intends to
> support tuple routing and hence 1-way tuple moving needs to updated like
> postgres_fdw was in PG 11.
That's right; the "if the FDW supports it" in the documentation refers
to the FDW's support for the callback functions BeginForeignInsert() and
EndForeignInsert() described in 57.2.4. FDW Routines For Updating
Foreign Tables [1] in addition to ExecForeignInsert(), as stated there:
"Tuples inserted into a partitioned table by INSERT or COPY FROM are
routed to partitions. If an FDW supports routable foreign-table
partitions, it should also provide the following callback functions."
Best regards,
Etsuro Fujita
[1]
https://www.postgresql.org/docs/current/fdw-callbacks.html#FDW-CALLBACKS-UPDATE
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: fujita.etsuro@lab.ntt.co.jp, Langote_Amit_f8@lab.ntt.co.jp, david.rowley@2ndquadrant.com, pgsql-hackers@lists.postgresql.org, robertmhaas@gmail.com, alvherre@2ndquadrant.com, derek.hans@gmail.com
Subject: Re: Update does not move row across foreign partitions in v11
In-Reply-To: <5C7F65B9.9050804@lab.ntt.co.jp>
References: <CAGrP7a3Xc1Qy_B2WJcgAD8uQTS_NDcJn06O5mtS_Ne1nYhBsyw@mail.gmail.com> <20190227193114.GA19279@alvherre.pgsql> <CAGrP7a0VhvM23m_kSsXUc1iAj4Z5DkyBaqq=fhxAS8VxNaFZ5w@mail.gmail.com> <CAKJS1f-kwK71B8TV7tbe5dpbhVvR-7J5TqHCiQkw8pbwdwD-dw@mail.gmail.com> <5C7F3E94.2060101@lab.ntt.co.jp> <CAKJS1f-SauQJftjcaQ7C_tzHh_be5C8shT-E9qYnVp+jh4-Fww@mail.gmail.com> <2396e176-ede8-cfbc-d012-fdb7a7e8b1f0@lab.ntt.co.jp> <CAKJS1f81JuXMv+Ay8Nbfisgi+76Y2f9PO-jVw_J5-E_KpBN_Mg@mail.gmail.com> <dcd27055-2d46-0990-60fc-5344b9232365@lab.ntt.co.jp> <5C7F65B9.9050804@lab.ntt.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox