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

Function get_attgenerated

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

* get_attgenerated * * Given the relation id and the attribute number, * return the "attgenerated" field from the attribute relation. * * Errors if not found. * * Since not generated is represented by '\0', this can also be used as a * Boolean test. */

Source from the content-addressed store, hash-verified

1060 * Boolean test.
1061 */
1062char
1063get_attgenerated(Oid relid, AttrNumber attnum)
1064{
1065 HeapTuple tp;
1066 Form_pg_attribute att_tup;
1067 char result;
1068
1069 tp = SearchSysCache2(ATTNUM,
1070 ObjectIdGetDatum(relid),
1071 Int16GetDatum(attnum));
1072 if (!HeapTupleIsValid(tp))
1073 elog(ERROR, "cache lookup failed for attribute %d of relation %u",
1074 attnum, relid);
1075 att_tup = (Form_pg_attribute) GETSTRUCT(tp);
1076 result = att_tup->attgenerated;
1077 ReleaseSysCache(tp);
1078 return result;
1079}
1080
1081/*
1082 * get_atttype

Callers 2

ATExecAlterColumnTypeFunction · 0.85

Calls 4

SearchSysCache2Function · 0.85
ObjectIdGetDatumFunction · 0.85
Int16GetDatumFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected