SPI_GETBINVAL(3)
β¨ 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 at1, not0π¨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
- opensuse-leap 16.0: postgresql16-docs 16.15-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