Follow the link for more info:
Created
December 14, 2015 14:35
-
-
Save Gurpartap/b213202380f655bd10a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c | |
index dabaea9..9db4c91 100644 | |
--- a/src/backend/executor/nodeModifyTable.c | |
+++ b/src/backend/executor/nodeModifyTable.c | |
@@ -1181,8 +1181,17 @@ ExecOnConflictUpdate(ModifyTableState *mtstate, | |
/* Project the new tuple version */ | |
ExecProject(resultRelInfo->ri_onConflictSetProj, NULL); | |
+ /* | |
+ * Note that it is possible that the target tuple has been modified in | |
+ * this session, after the above heap_lock_tuple. We choose to not error | |
+ * out in that case, in line with ExecUpdate's treatment of similar | |
+ * cases. This can happen if an UPDATE is triggered from within | |
+ * ExecQual(), ExecWithCheckOptions() or ExecProject() above, e.g. by | |
+ * selecting from a wCTE in the ON CONFLICT's SET. | |
+ */ | |
+ | |
/* Execute UPDATE with projection */ | |
- *returning = ExecUpdate(&tuple.t_data->t_ctid, NULL, | |
+ *returning = ExecUpdate(&tuple.t_self, NULL, | |
mtstate->mt_conflproj, planSlot, | |
&mtstate->mt_epqstate, mtstate->ps.state, | |
canSetTag); |
Author
Gurpartap
commented
Dec 14, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment