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

Function typeidTypeRelid

src/backend/parser/parse_type.c:667–681  ·  view source on GitHub ↗

* Given a typeid, return the type's typrelid (associated relation), if any. * Returns InvalidOid if type is not a composite type. */

Source from the content-addressed store, hash-verified

665 * Returns InvalidOid if type is not a composite type.
666 */
667Oid
668typeidTypeRelid(Oid type_id)
669{
670 HeapTuple typeTuple;
671 Form_pg_type type;
672 Oid result;
673
674 typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_id));
675 if (!HeapTupleIsValid(typeTuple))
676 elog(ERROR, "cache lookup failed for type %u", type_id);
677 type = (Form_pg_type) GETSTRUCT(typeTuple);
678 result = type->typrelid;
679 ReleaseSysCache(typeTuple);
680 return result;
681}
682
683/*
684 * Given a typeid, return the type's typrelid (associated relation), if any.

Callers 2

typeInheritsFromFunction · 0.85

Calls 3

SearchSysCache1Function · 0.85
ObjectIdGetDatumFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected