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

Function CdbOpenTable

src/backend/access/table/table.c:275–292  ·  view source on GitHub ↗

* CdbOpenTable -- Opens a table with a specified lock mode. * * CDB: Like CdbTryOpenTable, except that it guarantees either * an error or a valid opened table returned. */

Source from the content-addressed store, hash-verified

273 * an error or a valid opened table returned.
274 */
275Relation
276CdbOpenTable(Oid relid, LOCKMODE reqmode, bool *lockUpgraded)
277{
278 Relation rel;
279
280 rel = CdbTryOpenTable(relid, reqmode, lockUpgraded);
281
282 if (!RelationIsValid(rel))
283 {
284 ereport(ERROR,
285 (errcode(ERRCODE_UNDEFINED_TABLE),
286 errmsg("table not found (OID %u)", relid),
287 errdetail("This can be validly caused by a concurrent delete operation on this object.")));
288 }
289
290 return rel;
291
292} /* CdbOpenTable */

Callers 1

AcquireRewriteLocksFunction · 0.85

Calls 4

CdbTryOpenTableFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50
errdetailFunction · 0.50

Tested by

no test coverage detected