SPI_GETBINVAL(3)

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

✨ NAME ✨

okay so this is the SPI_GETBINVAL(3) manual page, bestie, and the function is SPI_getbinval β€” it returns the binary value of the specified column. iconic behavior, honestly πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

Datum SPI_getbinval(HeapTuple row, TupleDesc rowdesc, int colnumber,
                    bool * isnull)

πŸ¦‹ DESCRIPTION πŸ¦‹

SPI_getbinval returns the value of the specified column in the internal form (as type Datum). yes queen, internal form πŸ’–

This function does not allocate new space for the datum. In the case of a pass-by-reference data type, the return value will be a pointer into the passed row. no cap, that detail matters 🫢

🌸 important vibe check: no new space gets allocated for the datum, and for pass-by-reference data types you're getting a pointer into the row you passed in.

πŸ’œ ARGUMENTS πŸ’œ

  • HeapTuple row β€” the input row to be examined, aka the row we're looking at πŸ‘€
  • TupleDesc rowdesc β€” the input row description, the little map of what's in the row πŸ—ΊοΈ
  • int colnumber β€” the column number, and bestie the count starts at 1, not 0 🚨
  • bool * isnull β€” flag for a null value in the column, so we know if it's giving null energy πŸ’€

🌈 RETURN VALUE 🌈

The binary value of the column is returned. the variable pointed to by isnull is set to true if the column is null, else to false. periodt ✨

SPI_result is set to SPI_ERROR_NOATTRIBUTE on error. so if it errors, that's the flag you'll see πŸ‘‘


made with πŸ’– from the PostgreSQL 16.15 docs, dated 2026 β€” byeee bestie, slay your C code πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from