SPI_GETBINVAL(3)

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

🌸 NAME 🌸

Okay so this is the manual page for SPI_GETBINVAL(3), and the main character here is SPI_getbinval β€” it returns the binary value of the column you specify. Periodt. πŸ’…


✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So SPI_getbinval gives you the value of the column you picked, in the internal form β€” as type Datum. No extra packaging, no cute little wrapper, just the raw internal vibe. πŸ’–

This function does not allocate new space for the datum. If it’s a pass-by-reference data type, the return value will be a pointer into the row you passed in. That’s important, bestie β€” it’s pointing into the row, not making a fresh copy. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • HeapTuple row β€” the input row you’re examining. Like, the row in question. πŸ”
  • TupleDesc rowdesc β€” the input row description.
  • int colnumber β€” the column number, and the count starts at 1. Not zero. Don’t come for me, that’s just how it is. πŸ’€
  • bool * isnull β€” flag for a null value in the column.

πŸ’œ RETURN VALUE πŸ’œ

You get the binary value of the column back. The variable pointed to by isnull is set to true if the column is null, else it’s set to false. Easy. 🫢

And if something goes wrong? SPI_result is set to SPI_ERROR_NOATTRIBUTE on error. Noted, bestie. 😭


Stay iconic and may your columns never surprise you πŸ’… β€” this page is from PostgreSQL 15.19, dated 2026, and its manual name is SPI_GETBINVAL(3). Bye~ πŸŽ€βœ¨

πŸ“¦ where this page comes from