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

Function attnumAttName

src/backend/parser/parse_relation.c:3784–3797  ·  view source on GitHub ↗

* given attribute id, return name of that attribute * * This should only be used if the relation is already * table_open()'ed. Use the cache version get_atttype() * for access to non-opened relations. */

Source from the content-addressed store, hash-verified

3782 * for access to non-opened relations.
3783 */
3784const NameData *
3785attnumAttName(Relation rd, int attid)
3786{
3787 if (attid <= 0)
3788 {
3789 const FormData_pg_attribute *sysatt;
3790
3791 sysatt = SystemAttributeDefinition(attid);
3792 return &sysatt->attname;
3793 }
3794 if (attid > rd->rd_att->natts)
3795 elog(ERROR, "invalid attribute number %d", attid);
3796 return &TupleDescAttr(rd->rd_att, attid - 1)->attname;
3797}
3798
3799/*
3800 * given attribute id, return type of that attribute

Callers 1

Calls 1

Tested by

no test coverage detected