MCPcopy Create free account
hub / github.com/apache/cloudberry / swapAppendonlyEntriesUsingTAM

Function swapAppendonlyEntriesUsingTAM

src/backend/catalog/pg_appendonly.c:485–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485static void
486swapAppendonlyEntriesUsingTAM(Form_pg_class relform1, Form_pg_class relform2, TransactionId frozenXid, MultiXactId cutoffMulti)
487{
488 /*
489 * Swap auxiliary tables if the table AM has non-standard structure.
490 * See the details of the callback swap_relation_files.
491 */
492 if (relform1->relkind == RELKIND_RELATION ||
493 relform1->relkind == RELKIND_MATVIEW)
494 {
495 const TableAmRoutine *tam;
496 Oid relam;
497 relam = relform1->relam;
498 if (relam != relform2->relam)
499 elog(ERROR, "can't swap relation files for different AM");
500 tam = GetTableAmRoutineByAmId(relam);
501 if (tam->swap_relation_files)
502 tam->swap_relation_files(relform1->oid, relform2->oid, frozenXid, cutoffMulti);
503 }
504}
505
506/*
507 * This function acts as a controller of catalog actions that needs to be

Callers 1

ATAOEntriesFunction · 0.85

Calls 1

GetTableAmRoutineByAmIdFunction · 0.85

Tested by

no test coverage detected