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

Function SPI_gettypeid

src/backend/executor/spi.c:1335–1351  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1333 * thereof should inspect the TupleDesc directly.
1334 */
1335Oid
1336SPI_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
1353char *
1354SPI_getrelname(Relation rel)

Callers 13

moddatetimeFunction · 0.85
insert_usernameFunction · 0.85
check_primary_keyFunction · 0.85
check_foreign_keyFunction · 0.85
autoincFunction · 0.85
tsquery_rewrite_queryFunction · 0.85
ts_stat_sqlFunction · 0.85
tsvector_update_triggerFunction · 0.85
ttdummyFunction · 0.85

Calls 1

Tested by 1

ttdummyFunction · 0.68