diff --git a/doc/src/sgml/ref/update.sgml b/doc/src/sgml/ref/update.sgml index 3ba13010e7..3a0285df79 100644 --- a/doc/src/sgml/ref/update.sgml +++ b/doc/src/sgml/ref/update.sgml @@ -319,9 +319,9 @@ UPDATE count An attempt of moving a row from one partition to another will fail if a - foreign key is found to directly reference a non-root partitioned table - in the partition tree, unless that table is also directly mentioned - in the UPDATEquery. + foreign key is found to directly reference an ancestor of the source + partition that is not the same as the ancestor that's mentioned in the + UPDATE query. diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 0adecdea22..5fa395fcc2 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -3542,7 +3542,7 @@ typedef SetConstraintStateData *SetConstraintState; * Per-trigger-event data * * The actual per-event data, AfterTriggerEventData, includes DONE/IN_PROGRESS - * status bits, up to two tuple CTIDs, and optionally two OIDs of partitions + * status bits, up to two tuple CTIDs, and optionally two OIDs of partitions. * Each event record also has an associated AfterTriggerSharedData that is * shared across all instances of similar events within a "chunk". * @@ -3555,10 +3555,10 @@ typedef SetConstraintStateData *SetConstraintState; * tuple(s). This permits storing tuples once regardless of the number of * row-level triggers on a foreign table. * - * When updates move tuples in partitioned tables to different partitions, + * When updates of a partitioned table causes rows to move between partitions, * the OIDs of both partitions are stored too, so that the tuples can be * fetched; such entries are marked AFTER_TRIGGER_CP_UPDATE (for "cross- - * partition"). + * partition update"). * * Note that we need triggers on foreign tables to be fired in exactly the * order they were queued, so that the tuples come out of the tuplestore in diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index de46315405..c822b5b744 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -1981,7 +1981,7 @@ ExecCrossPartitionUpdateForeignKey(ModifyTableContext *context, TriggerDesc *trigdesc = rInfo->ri_TrigDesc; bool has_noncloned_fkey = false; - /* Ignore the root ancestor, because ...?? */ + /* Root ancestor's triggers will be processed. */ if (rInfo == rootRelInfo) continue;