* RelationGetPrimaryKeyIndex -- get OID of the relation's primary key index * * Returns InvalidOid if there is no such index. */
| 5128 | * Returns InvalidOid if there is no such index. |
| 5129 | */ |
| 5130 | Oid |
| 5131 | RelationGetPrimaryKeyIndex(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 |
no test coverage detected