* Get the data type OID for a column. * * There's nothing similar for typmod and typcollation. The rare consumers * thereof should inspect the TupleDesc directly. */
| 1333 | * thereof should inspect the TupleDesc directly. |
| 1334 | */ |
| 1335 | Oid |
| 1336 | SPI_gettypeid(TupleDesc tupdesc, int fnumber) |
| 1337 | { |
| 1338 | SPI_result = 0; |
| 1339 | |
| 1340 | if (fnumber > tupdesc->natts || fnumber == 0 || |
| 1341 | fnumber <= FirstLowInvalidHeapAttributeNumber) |
| 1342 | { |
| 1343 | SPI_result = SPI_ERROR_NOATTRIBUTE; |
| 1344 | return InvalidOid; |
| 1345 | } |
| 1346 | |
| 1347 | if (fnumber > 0) |
| 1348 | return TupleDescAttr(tupdesc, fnumber - 1)->atttypid; |
| 1349 | else |
| 1350 | return (SystemAttributeDefinition(fnumber))->atttypid; |
| 1351 | } |
| 1352 | |
| 1353 | char * |
| 1354 | SPI_getrelname(Relation rel) |