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

Function RelationGetPrimaryKeyIndex

src/backend/utils/cache/relcache.c:5130–5144  ·  view source on GitHub ↗

* RelationGetPrimaryKeyIndex -- get OID of the relation's primary key index * * Returns InvalidOid if there is no such index. */

Source from the content-addressed store, hash-verified

5128 * Returns InvalidOid if there is no such index.
5129 */
5130Oid
5131RelationGetPrimaryKeyIndex(Relation relation)
5132{
5133 List *ilist;
5134
5135 if (!relation->rd_indexvalid)
5136 {
5137 /* RelationGetIndexList does the heavy lifting. */
5138 ilist = RelationGetIndexList(relation);
5139 list_free(ilist);
5140 Assert(relation->rd_indexvalid);
5141 }
5142
5143 return relation->rd_pkindex;
5144}
5145
5146/*
5147 * RelationGetReplicaIndex -- get OID of the relation's replica identity index

Callers 2

GetRelationIdentityOrPKFunction · 0.85
build_replindex_scan_keyFunction · 0.85

Calls 2

RelationGetIndexListFunction · 0.85
list_freeFunction · 0.50

Tested by

no test coverage detected