SPI_GETBINVAL(3)
β¨ NAME β¨
SPI_getbinval β return the binary value of the specified column, bestie. This is the SPI_GETBINVAL(3) page and it's literally giving βI know exactly which column I want.β π
πΈ SYNOPSIS πΈ
Datum SPI_getbinval(HeapTuple row, TupleDesc rowdesc, int colnumber,
bool * isnull)
π¦ DESCRIPTION π¦
Okay so SPI_getbinval returns the value of the specified column in the internal form, as type Datum. No cap. It's that simple and that iconic. β¨
This function does not allocate new space for the datum. Zero new allocation, zero drama. In the case of a pass-by-reference data type, the return value will be a pointer into the passed row. So yeah, it's pointing back at the row you gave it β keep that in mind, bestie. π«Ά
π ARGUMENTS π
HeapTuple rowβ the input row to be examined. Like, the row you're investigating. πTupleDesc rowdescβ the input row description. The little map of what's in the row. πΊοΈint colnumberβ column number, and the count starts at1. Not zero. One. Periodt. πbool * isnullβ flag for a null value in the column. It's the βis this column null?β receipt. π§Ύ
π 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. So you get the value and the null check, all in one glorious little operation. π
SPI_result is set to SPI_ERROR_NOATTRIBUTE on error. That's the error vibe check, iykyk. π
π«Ά Cute little sign-off: this page is from PostgreSQL 14.24 Documentation, dated 2026, and it's serving SPI_GETBINVAL(3) energy. Mwah. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14-docs 14.24-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