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

Function SearchSysCacheAttName

src/backend/utils/cache/syscache.c:1496–1512  ·  view source on GitHub ↗

* SearchSysCacheAttName * * This routine is equivalent to SearchSysCache on the ATTNAME cache, * except that it will return NULL if the found attribute is marked * attisdropped. This is convenient for callers that want to act as * though dropped attributes don't exist. */

Source from the content-addressed store, hash-verified

1494 * though dropped attributes don't exist.
1495 */
1496HeapTuple
1497SearchSysCacheAttName(Oid relid, const char *attname)
1498{
1499 HeapTuple tuple;
1500
1501 tuple = SearchSysCache2(ATTNAME,
1502 ObjectIdGetDatum(relid),
1503 CStringGetDatum(attname));
1504 if (!HeapTupleIsValid(tuple))
1505 return NULL;
1506 if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
1507 {
1508 ReleaseSysCache(tuple);
1509 return NULL;
1510 }
1511 return tuple;
1512}
1513
1514/*
1515 * SearchSysCacheCopyAttName

Callers 15

plpgsql_parse_cwordtypeFunction · 0.85
get_attnumFunction · 0.85
ComputeIndexAttrsFunction · 0.85
CreateStatisticsFunction · 0.85
ATPrepSetNotNullFunction · 0.85
ATExecCheckNotNullFunction · 0.85
ATExecSetOptionsFunction · 0.85
ATExecDropColumnFunction · 0.85
transformColumnNameListFunction · 0.85
ATPrepAlterColumnTypeFunction · 0.85

Calls 4

SearchSysCache2Function · 0.85
ObjectIdGetDatumFunction · 0.85
CStringGetDatumFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected