aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeLockRows.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeLockRows.c')
-rw-r--r--src/backend/executor/nodeLockRows.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/backend/executor/nodeLockRows.c b/src/backend/executor/nodeLockRows.c
index 41513ceec65..72c5b7cab2d 100644
--- a/src/backend/executor/nodeLockRows.c
+++ b/src/backend/executor/nodeLockRows.c
@@ -65,12 +65,6 @@ lnext:
epq_needed = false;
/*
- * Initialize EPQ machinery. Need to do that early because source tuples
- * are stored in slots initialized therein.
- */
- EvalPlanQualBegin(&node->lr_epqstate, estate);
-
- /*
* Attempt to lock the source tuple(s). (Note we only have locking
* rowmarks in lr_arowMarks.)
*/
@@ -259,12 +253,14 @@ lnext:
*/
if (epq_needed)
{
+ /* Initialize EPQ machinery */
+ EvalPlanQualBegin(&node->lr_epqstate);
+
/*
- * Now fetch any non-locked source rows --- the EPQ logic knows how to
- * do that.
+ * To fetch non-locked source rows the EPQ logic needs to access junk
+ * columns from the tuple being tested.
*/
EvalPlanQualSetSlot(&node->lr_epqstate, slot);
- EvalPlanQualFetchRowMarks(&node->lr_epqstate);
/*
* And finally we can re-evaluate the tuple.