SPI_FNUMBER(3)

πŸ“¦ version 17.11, in opensuse-leap 16.0

πŸ’… 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 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. do not do the lazy <= 0 check 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