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

Function errtablecol

src/backend/utils/cache/relcache.c:6022–6035  ·  view source on GitHub ↗

* errtablecol --- stores schema_name, table_name and column_name * of a table column within the current errordata. * * The column is specified by attribute number --- for most callers, this is * easier and less error-prone than getting the column name for themselves. */

Source from the content-addressed store, hash-verified

6020 * easier and less error-prone than getting the column name for themselves.
6021 */
6022int
6023errtablecol(Relation rel, int attnum)
6024{
6025 TupleDesc reldesc = RelationGetDescr(rel);
6026 const char *colname;
6027
6028 /* Use reldesc if it's a user attribute, else consult the catalogs */
6029 if (attnum > 0 && attnum <= reldesc->natts)
6030 colname = NameStr(TupleDescAttr(reldesc, attnum - 1)->attname);
6031 else
6032 colname = get_attname(RelationGetRelid(rel), attnum, false);
6033
6034 return errtablecolname(rel, colname);
6035}
6036
6037/*
6038 * errtablecolname --- stores schema_name, table_name and column_name

Callers 4

AlterDomainNotNullFunction · 0.85
validateDomainConstraintFunction · 0.85
ATRewriteTableFunction · 0.85
ExecConstraintsFunction · 0.85

Calls 2

get_attnameFunction · 0.85
errtablecolnameFunction · 0.85

Tested by

no test coverage detected