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

Function get_typlen

src/backend/utils/cache/lsyscache.c:2797–2814  ·  view source on GitHub ↗

* get_typlen * * Given the type OID, return the length of the type. */

Source from the content-addressed store, hash-verified

2795 * Given the type OID, return the length of the type.
2796 */
2797int16
2798get_typlen(Oid typid)
2799{
2800 HeapTuple tp;
2801
2802 tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
2803 if (HeapTupleIsValid(tp))
2804 {
2805 Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
2806 int16 result;
2807
2808 result = typtup->typlen;
2809 ReleaseSysCache(tp);
2810 return result;
2811 }
2812 else
2813 return 0;
2814}
2815
2816/*
2817 * get_typbyval

Callers 12

GetTyplenMethod · 0.85
build_sorted_itemsFunction · 0.85
get_typavgwidthFunction · 0.85
array_exec_setupFunction · 0.85
pg_column_sizeFunction · 0.85
pg_column_compressionFunction · 0.85
DefineTypeFunction · 0.85
range_serializeFunction · 0.85
range_deserializeFunction · 0.85
ExecBuildProjectionInfoFunction · 0.85
ExecInitExprRecFunction · 0.85
ExecInitCoerceToDomainFunction · 0.85

Calls 3

SearchSysCache1Function · 0.85
ObjectIdGetDatumFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected