* GetTableAmRoutine * Call the specified access method handler routine to get its * TableAmRoutine struct, which will be palloc'd in the caller's * memory context. */
| 31 | * memory context. |
| 32 | */ |
| 33 | const TableAmRoutine * |
| 34 | GetTableAmRoutine(Oid amhandler) |
| 35 | { |
| 36 | Datum datum; |
| 37 | const TableAmRoutine *routine; |
| 38 | |
| 39 | datum = OidFunctionCall0(amhandler); |
| 40 | routine = (TableAmRoutine *) DatumGetPointer(datum); |
| 41 | |
| 42 | if (routine == NULL || !IsA(routine, TableAmRoutine)) |
| 43 | elog(ERROR, "table access method handler %u did not return a TableAmRoutine struct", |
| 44 | amhandler); |
| 45 | |
| 46 | /* |
| 47 | * Assert that all required callbacks are present. That makes it a bit |
| 48 | * easier to keep AMs up to date, e.g. when forward porting them to a new |
| 49 | * major version. |
| 50 | */ |
| 51 | Assert(routine->scan_begin != NULL); |
| 52 | Assert(routine->scan_end != NULL); |
| 53 | Assert(routine->scan_rescan != NULL); |
| 54 | Assert(routine->scan_getnextslot != NULL); |
| 55 | |
| 56 | Assert(routine->parallelscan_estimate != NULL); |
| 57 | Assert(routine->parallelscan_initialize != NULL); |
| 58 | Assert(routine->parallelscan_reinitialize != NULL); |
| 59 | |
| 60 | Assert(routine->index_fetch_begin != NULL); |
| 61 | Assert(routine->index_fetch_reset != NULL); |
| 62 | Assert(routine->index_fetch_end != NULL); |
| 63 | Assert(routine->index_fetch_tuple != NULL); |
| 64 | |
| 65 | Assert(routine->tuple_fetch_row_version != NULL); |
| 66 | Assert(routine->tuple_tid_valid != NULL); |
| 67 | Assert(routine->tuple_get_latest_tid != NULL); |
| 68 | Assert(routine->tuple_satisfies_snapshot != NULL); |
| 69 | Assert(routine->index_delete_tuples != NULL); |
| 70 | |
| 71 | Assert(routine->tuple_insert != NULL); |
| 72 | |
| 73 | /* |
| 74 | * Could be made optional, but would require throwing error during |
| 75 | * parse-analysis. |
| 76 | */ |
| 77 | Assert(routine->tuple_insert_speculative != NULL); |
| 78 | Assert(routine->tuple_complete_speculative != NULL); |
| 79 | |
| 80 | Assert(routine->multi_insert != NULL); |
| 81 | Assert(routine->tuple_delete != NULL); |
| 82 | Assert(routine->tuple_update != NULL); |
| 83 | Assert(routine->tuple_lock != NULL); |
| 84 | |
| 85 | Assert(routine->relation_set_new_filenode != NULL); |
| 86 | Assert(routine->relation_nontransactional_truncate != NULL); |
| 87 | Assert(routine->relation_copy_data != NULL); |
| 88 | Assert(routine->relation_copy_for_cluster != NULL); |
| 89 | Assert(routine->relation_vacuum != NULL); |
| 90 | Assert(routine->scan_analyze_next_block != NULL); |
no outgoing calls
no test coverage detected