1SPI_FNUMBER(3) PostgreSQL 13.4 Documentation SPI_FNUMBER(3)
2
3
4
6 SPI_fnumber - determine the column number for the specified column name
7
9 int SPI_fnumber(TupleDesc rowdesc, const char * colname)
10
12 SPI_fnumber returns the column number for the column with the specified
13 name.
14
15 If colname refers to a system column (e.g., ctid) then the appropriate
16 negative column number will be returned. The caller should be careful
17 to test the return value for exact equality to SPI_ERROR_NOATTRIBUTE to
18 detect an error; testing the result for less than or equal to 0 is not
19 correct unless system columns should be rejected.
20
22 TupleDesc rowdesc
23 input row description
24
25 const char * colname
26 column name
27
29 Column number (count starts at 1 for user-defined columns), or
30 SPI_ERROR_NOATTRIBUTE if the named column was not found.
31
32
33
34PostgreSQL 13.4 2021 SPI_FNUMBER(3)