SPI_FNUMBER(3)
πΈ NAME πΈ
okay so bestie, welcome to SPI_FNUMBER(3) from the PostgreSQL 13.23 documentation β this page is literally about finding the column number for a column name. The NAME tea is:
SPI_fnumberβ determine the column number for the specified column name. periodt. π
β¨ SYNOPSIS β¨
int SPI_fnumber(TupleDesc rowdesc, const char * colname)
π DESCRIPTION π
SPI_fnumber returns the column number for the column with the specified name. iconic behavior, honestly. π
If colname refers to a system column (e.g., ctid), then the appropriate negative column number will be returned. plot twist!! π
The caller should be careful to test the return value for exact equality to SPI_ERROR_NOATTRIBUTE to detect an error; testing the result for less than or equal to 0 is not correct unless system columns should be rejected. like, do not be messy about this check, bestie. π
π ARGUMENTS π
TupleDesc rowdescβ input row description. the rowdesc in question, fr fr. π«Άconst char * colnameβ column name. the name weβre looking up. β¨
π¦ 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 the whole vibe check. π
mwah π β this page is from PostgreSQL 13.23, dated 2025, and itβs the SPI_FNUMBER(3) manual page. slay and goodbye. ππ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13-docs 13.23-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