diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-08-03 12:47:00 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-08-03 12:47:00 -0400 |
commit | 12a34f59bf8bc5babf375c95f5192d208dca1739 (patch) | |
tree | 36023671bdbb2e545545ed5c45b00fc00c551ada /src/backend/executor/nodeModifyTable.c | |
parent | 610e8ebb0fadd7a738c2ad07fef6c5ea86b11f8d (diff) | |
download | postgresql-12a34f59bf8bc5babf375c95f5192d208dca1739.tar.gz postgresql-12a34f59bf8bc5babf375c95f5192d208dca1739.zip |
Improve ExecModifyTable comments.
Some of these comments wrongly implied that only an AFTER ROW trigger
will cause a 'wholerow' attribute to be present for a foreign table,
but a BEFORE ROW trigger can have the same effect. Others implied
that it would always be present for a foreign table, but that's not
true either.
Etsuro Fujita and Robert Haas
Discussion: http://postgr.es/m/10026bc7-1403-ef85-9e43-c6100c1cc0e3@lab.ntt.co.jp
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
-rw-r--r-- | src/backend/executor/nodeModifyTable.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index 435aed3b8bc..30add8e3c7a 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -1696,7 +1696,7 @@ ExecModifyTable(PlanState *pstate) * 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 @@ -2182,8 +2182,11 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) /* * Initialize the junk filter(s) if needed. INSERT queries need a filter * if there are any junk attrs in the tlist. UPDATE and DELETE always - * need a filter, since there's always a junk 'ctid' or 'wholerow' - * attribute present --- no need to look first. + * need a filter, since there's always at least one junk attribute present + * --- no need to look first. Typically, this will be a 'ctid' or + * 'wholerow' attribute, but in the case of a foreign data wrapper it + * might be a set of junk attributes sufficient to identify the remote + * row. * * If there are multiple result relations, each one needs its own junk * filter. Note multiple rels are only possible for UPDATE/DELETE, so we @@ -2251,7 +2254,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"); |