@@ -223,12 +223,12 @@ partition_router_exec(CustomScanState *node)
223223 /* Magic: replace parent's ResultRelInfo with ours */
224224 estate -> es_result_relation_info = state -> current_rri ;
225225
226- /* Delete tuple from old partition */
226+ /* Lock or delete tuple from old partition */
227227 Assert (ItemPointerIsValid (& ctid ));
228228 slot = router_lock_or_delete_tuple (state , slot , & ctid ,
229229 & deleted , estate );
230230
231- /* We require a tuple */
231+ /* We require a tuple (previous one has vanished) */
232232 if (TupIsNull (slot ))
233233 goto take_next_tuple ;
234234
@@ -265,12 +265,15 @@ partition_router_rescan(CustomScanState *node)
265265}
266266
267267void
268- partition_router_explain (CustomScanState * node , List * ancestors , ExplainState * es )
268+ partition_router_explain (CustomScanState * node ,
269+ List * ancestors ,
270+ ExplainState * es )
269271{
270272 /* Nothing to do here now */
271273}
272274
273275
276+ /* Smart wrapper over ModifyTable */
274277static TupleTableSlot *
275278router_run_modify_table (PlanState * state )
276279{
@@ -309,6 +312,7 @@ router_run_modify_table(PlanState *state)
309312 return slot ;
310313}
311314
315+ /* Return tuple OR stash it and change ModifyTable's operation */
312316static TupleTableSlot *
313317router_set_slot (PartitionRouterState * state ,
314318 TupleTableSlot * slot ,
@@ -337,6 +341,7 @@ router_set_slot(PartitionRouterState *state,
337341 return NULL ;
338342}
339343
344+ /* Fetch next tuple (either fresh or stashed) */
340345static TupleTableSlot *
341346router_get_slot (PartitionRouterState * state ,
342347 bool * should_process )
0 commit comments