* ExecMarkPos * * Marks the current scan position. * * NOTE: mark/restore capability is currently needed only for plan nodes * that are the immediate inner child of a MergeJoin node. Since MergeJoin * requires sorted input, there is never any need to support mark/restore in * node types that cannot produce sorted output. There are some cases in * which a node can pass through sorted data
| 416 | * inserting a Material node above that node. |
| 417 | */ |
| 418 | void |
| 419 | ExecMarkPos(PlanState *node) |
| 420 | { |
| 421 | switch (nodeTag(node)) |
| 422 | { |
| 423 | case T_IndexScanState: |
| 424 | ExecIndexMarkPos((IndexScanState *) node); |
| 425 | break; |
| 426 | |
| 427 | case T_IndexOnlyScanState: |
| 428 | ExecIndexOnlyMarkPos((IndexOnlyScanState *) node); |
| 429 | break; |
| 430 | |
| 431 | case T_CustomScanState: |
| 432 | ExecCustomMarkPos((CustomScanState *) node); |
| 433 | break; |
| 434 | |
| 435 | case T_MaterialState: |
| 436 | ExecMaterialMarkPos((MaterialState *) node); |
| 437 | break; |
| 438 | |
| 439 | case T_SortState: |
| 440 | ExecSortMarkPos((SortState *) node); |
| 441 | break; |
| 442 | |
| 443 | case T_ResultState: |
| 444 | ExecResultMarkPos((ResultState *) node); |
| 445 | break; |
| 446 | |
| 447 | case T_MotionState: |
| 448 | ereport(ERROR, ( |
| 449 | errcode(ERRCODE_INTERNAL_ERROR), |
| 450 | errmsg("unsupported call to mark position of Motion operator") |
| 451 | )); |
| 452 | break; |
| 453 | |
| 454 | case T_ForeignScanState: |
| 455 | case T_DynamicForeignScanState: |
| 456 | elog(ERROR, "Marking scan position for foreign relation is not supported"); |
| 457 | break; |
| 458 | |
| 459 | default: |
| 460 | /* don't make hard error unless caller asks to restore... */ |
| 461 | elog(DEBUG2, "unrecognized node type: %d", (int) nodeTag(node)); |
| 462 | break; |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | /* |
| 467 | * ExecRestrPos |
no test coverage detected