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

Function attnumTypeId

src/backend/parser/parse_relation.c:3806–3819  ·  view source on GitHub ↗

* given attribute id, return type 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

3804 * for access to non-opened relations.
3805 */
3806Oid
3807attnumTypeId(Relation rd, int attid)
3808{
3809 if (attid <= 0)
3810 {
3811 const FormData_pg_attribute *sysatt;
3812
3813 sysatt = SystemAttributeDefinition(attid);
3814 return sysatt->atttypid;
3815 }
3816 if (attid > rd->rd_att->natts)
3817 elog(ERROR, "invalid attribute number %d", attid);
3818 return TupleDescAttr(rd->rd_att, attid - 1)->atttypid;
3819}
3820
3821/*
3822 * given attribute id, return collation of that attribute

Callers 2

transformAssignedExprFunction · 0.85

Calls 1

Tested by

no test coverage detected