SPI_FNUMBER(3)
π SPI_FNUMBER(3) π
okay bestie, gather round β this is the manual page for SPI_fnumber, and it's literally about finding which column number matches a column name. no cap.
β¨ NAME β¨
SPI_fnumber β determine the column number for the specified column name. it's giving βwhere is that column at?β energy. π
πΈ SYNOPSIS πΈ
int SPI_fnumber(TupleDesc rowdesc, const char * colname)
π¦ DESCRIPTION π¦
SPI_fnumber returns the column number for the column with the specified name. that's the whole assignment, bestie.
If colname refers to a system column (e.g., ctid) then the appropriate negative column number will be returned. yes, negative β system columns are built different. π«Ά
β οΈ caller bestie, be careful: test the return value for exact equality toSPI_ERROR_NOATTRIBUTEto detect an error. testing the result for less than or equal to0is not correct unless system columns should be rejected. do not do the lazy<= 0check unless that is actually your vibe. π
π ARGUMENTS π
TupleDesc rowdescβ input row description. it's the row's ID card, basically.const char * colnameβ column name. the name you're looking for, fr fr.
π₯ RETURN VALUE π₯
Column number (count starts at 1 for user-defined columns), or SPI_ERROR_NOATTRIBUTE if the named column was not found. that's it. that's the tea. π
π that's the whole page, bestie! brought to you by PostgreSQL 17.11, dated 2026, and delivered with main-character energy. periodt. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17-docs 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms