@@ -223,12 +223,12 @@ partition_router_exec(CustomScanState *node)
223
223
/* Magic: replace parent's ResultRelInfo with ours */
224
224
estate -> es_result_relation_info = state -> current_rri ;
225
225
226
- /* Delete tuple from old partition */
226
+ /* Lock or delete tuple from old partition */
227
227
Assert (ItemPointerIsValid (& ctid ));
228
228
slot = router_lock_or_delete_tuple (state , slot , & ctid ,
229
229
& deleted , estate );
230
230
231
- /* We require a tuple */
231
+ /* We require a tuple (previous one has vanished) */
232
232
if (TupIsNull (slot ))
233
233
goto take_next_tuple ;
234
234
@@ -265,12 +265,15 @@ partition_router_rescan(CustomScanState *node)
265
265
}
266
266
267
267
void
268
- partition_router_explain (CustomScanState * node , List * ancestors , ExplainState * es )
268
+ partition_router_explain (CustomScanState * node ,
269
+ List * ancestors ,
270
+ ExplainState * es )
269
271
{
270
272
/* Nothing to do here now */
271
273
}
272
274
273
275
276
+ /* Smart wrapper over ModifyTable */
274
277
static TupleTableSlot *
275
278
router_run_modify_table (PlanState * state )
276
279
{
@@ -309,6 +312,7 @@ router_run_modify_table(PlanState *state)
309
312
return slot ;
310
313
}
311
314
315
+ /* Return tuple OR stash it and change ModifyTable's operation */
312
316
static TupleTableSlot *
313
317
router_set_slot (PartitionRouterState * state ,
314
318
TupleTableSlot * slot ,
@@ -337,6 +341,7 @@ router_set_slot(PartitionRouterState *state,
337
341
return NULL ;
338
342
}
339
343
344
+ /* Fetch next tuple (either fresh or stashed) */
340
345
static TupleTableSlot *
341
346
router_get_slot (PartitionRouterState * state ,
342
347
bool * should_process )
0 commit comments