* ExecRestrPos * * restores the scan position previously saved with ExecMarkPos() * * NOTE: the semantics of this are that the first ExecProcNode following * the restore operation will yield the same tuple as the first one following * the mark operation. It is unspecified what happens to the plan node's * result TupleTableSlot. (In most cases the result slot is unchanged by * a restore,
| 477 | * returned TupleTableSlot after doing a restore. |
| 478 | */ |
| 479 | void |
| 480 | ExecRestrPos(PlanState *node) |
| 481 | { |
| 482 | switch (nodeTag(node)) |
| 483 | { |
| 484 | case T_IndexScanState: |
| 485 | ExecIndexRestrPos((IndexScanState *) node); |
| 486 | break; |
| 487 | |
| 488 | case T_IndexOnlyScanState: |
| 489 | ExecIndexOnlyRestrPos((IndexOnlyScanState *) node); |
| 490 | break; |
| 491 | |
| 492 | case T_CustomScanState: |
| 493 | ExecCustomRestrPos((CustomScanState *) node); |
| 494 | break; |
| 495 | |
| 496 | case T_MaterialState: |
| 497 | ExecMaterialRestrPos((MaterialState *) node); |
| 498 | break; |
| 499 | |
| 500 | case T_SortState: |
| 501 | ExecSortRestrPos((SortState *) node); |
| 502 | break; |
| 503 | |
| 504 | case T_ResultState: |
| 505 | ExecResultRestrPos((ResultState *) node); |
| 506 | break; |
| 507 | |
| 508 | case T_MotionState: |
| 509 | ereport(ERROR, ( |
| 510 | errcode(ERRCODE_INTERNAL_ERROR), |
| 511 | errmsg("unsupported call to restore position of Motion operator") |
| 512 | )); |
| 513 | break; |
| 514 | |
| 515 | case T_ForeignScanState: |
| 516 | elog(ERROR, "Restoring scan position is not yet supported for foreign relation scan"); |
| 517 | break; |
| 518 | |
| 519 | default: |
| 520 | elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node)); |
| 521 | break; |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | /* |
| 526 | * ExecSupportsMarkRestore - does a Path support mark/restore? |
no test coverage detected