Skip to content

Commit 53f48a2

Browse files
author
Etsuro Fujita
committed
Add FDW documentation notes about insert and update tuple routing and COPY.
Author: Laurenz Albe and Etsuro Fujita Reviewed-by: Laurenz Albe and Amit Langote Backpatch-through: 11 where support for that by FDWs was added Discussion: https://postgr.es/m/bf36a0288e8f31b4f2f40952e225bf892dc1ffc5.camel@cybertec.at
1 parent b1f570b commit 53f48a2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

doc/src/sgml/fdwhandler.sgml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,14 @@ ExecForeignInsert(EState *estate,
587587
with an error message.
588588
</para>
589589

590+
<para>
591+
Note that this function is also called when inserting routed tuples into
592+
a foreign-table partition or executing <command>COPY FROM</command> on
593+
a foreign table, in which case it is called in a different way than it
594+
is in the <command>INSERT</command> case. See the callback functions
595+
described below that allow the FDW to support that.
596+
</para>
597+
590598
<para>
591599
<programlisting>
592600
TupleTableSlot *
@@ -743,6 +751,13 @@ BeginForeignInsert(ModifyTableState *mtstate,
743751
<literal>NULL</literal>, no action is taken for the initialization.
744752
</para>
745753

754+
<para>
755+
Note that if the FDW does not support routable foreign-table partitions
756+
and/or executing <command>COPY FROM</command> on foreign tables, this
757+
function or <function>ExecForeignInsert</function> subsequently called
758+
must throw error as needed.
759+
</para>
760+
746761
<para>
747762
<programlisting>
748763
void

doc/src/sgml/release-11.sgml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,6 +2594,9 @@ Branch: REL9_3_STABLE [84261eb10] 2018-10-19 17:02:26 -0400
25942594
<para>
25952595
This is supported by <filename>postgres_fdw</filename>
25962596
foreign tables.
2597+
Since the <function>ExecForeignInsert</function> callback function
2598+
is called for this in a different way than it used to be,
2599+
foreign data wrappers must be modified to cope with this change.
25972600
</para>
25982601
</listitem>
25992602

0 commit comments

Comments
 (0)