| 1223 | } |
| 1224 | |
| 1225 | char * |
| 1226 | SPI_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 | |
| 1247 | char * |
| 1248 | SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) |
no test coverage detected