While working on [1], I noticed that the comment in ExecModifyTable:

                 * Foreign table updates have a wholerow attribute when the
                 * relation has an AFTER ROW trigger.

is not 100% correct because a foreign table has a wholerow attrubute when the relation has an AFTER ROW or BEFORE ROW trigger (see rewriteTargetListUD). So I'd propose s/an AFTER ROW trigger/a row-level trigger/. Attached is a patch for that.

Best regards,
Etsuro Fujita

[1] https://www.postgresql.org/message-id/a31f779e-9cb8-1ea5-71a6-bca6adbfa6a4%40lab.ntt.co.jp
diff --git a/src/backend/executor/nodeModifyTable.c 
b/src/backend/executor/nodeModifyTable.c
index cf555fe..5dde93c 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -1554,7 +1554,7 @@ ExecModifyTable(ModifyTableState *node)
                                 * the old relation tuple.
                                 *
                                 * Foreign table updates have a wholerow 
attribute when the
-                                * relation has an AFTER ROW trigger.  Note 
that the wholerow
+                                * relation has a row-level trigger.  Note that 
the wholerow
                                 * attribute does not carry system columns.  
Foreign table
                                 * triggers miss seeing those, except that we 
know enough here
                                 * to set t_tableOid.  Quite separately from 
this, the FDW may
@@ -2093,7 +2093,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, 
int eflags)
                                        else if (relkind == 
RELKIND_FOREIGN_TABLE)
                                        {
                                                /*
-                                                * When there is an AFTER 
trigger, there should be a
+                                                * When there is a row-level 
trigger, there should be a
                                                 * wholerow attribute.
                                                 */
                                                j->jf_junkAttNo = 
ExecFindJunkAttribute(j, "wholerow");
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to