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

Function SPI_fnumber

src/backend/executor/spi.c:1202–1223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202int
1203SPI_fnumber(TupleDesc tupdesc, const char *fname)
1204{
1205 int res;
1206 const FormData_pg_attribute *sysatt;
1207
1208 for (res = 0; res < tupdesc->natts; res++)
1209 {
1210 Form_pg_attribute attr = TupleDescAttr(tupdesc, res);
1211
1212 if (namestrcmp(&attr->attname, fname) == 0 &&
1213 !attr->attisdropped)
1214 return res + 1;
1215 }
1216
1217 sysatt = SystemAttributeByName(fname);
1218 if (sysatt != NULL)
1219 return sysatt->attnum;
1220
1221 /* SPI_ERROR_NOATTRIBUTE is different from all sys column numbers */
1222 return SPI_ERROR_NOATTRIBUTE;
1223}
1224
1225char *
1226SPI_fname(TupleDesc tupdesc, int fnumber)

Callers 15

lo_manageFunction · 0.85
moddatetimeFunction · 0.85
insert_usernameFunction · 0.85
check_primary_keyFunction · 0.85
check_foreign_keyFunction · 0.85
autoincFunction · 0.85
pltcl_build_tuple_resultFunction · 0.85
plperl_modify_tupleFunction · 0.85
PLy_modify_tupleFunction · 0.85
make_ruledefFunction · 0.85
make_viewdefFunction · 0.85

Calls 2

namestrcmpFunction · 0.85
SystemAttributeByNameFunction · 0.85

Tested by 1

ttdummyFunction · 0.68