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

Function SPI_fname

src/backend/executor/spi.c:1225–1245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1223}
1224
1225char *
1226SPI_fname(TupleDesc tupdesc, int fnumber)
1227{
1228 const FormData_pg_attribute *att;
1229
1230 SPI_result = 0;
1231
1232 if (fnumber > tupdesc->natts || fnumber == 0 ||
1233 fnumber <= FirstLowInvalidHeapAttributeNumber)
1234 {
1235 SPI_result = SPI_ERROR_NOATTRIBUTE;
1236 return NULL;
1237 }
1238
1239 if (fnumber > 0)
1240 att = TupleDescAttr(tupdesc, fnumber - 1);
1241 else
1242 att = SystemAttributeDefinition(fnumber);
1243
1244 return pstrdup(NameStr(att->attname));
1245}
1246
1247char *
1248SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)

Callers 4

get_pkey_attnamesFunction · 0.85

Calls 2

pstrdupFunction · 0.50

Tested by

no test coverage detected