SPI_GETVALUE(3)

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

πŸ’– SPI_GETVALUE(3) β€” the bestie edition πŸ’–

Straight out of the PostgreSQL 13.23 Documentation, it's SPI_GETVALUE(3) πŸ’… and we're getting into it.

🌸 NAME 🌸

SPI_getvalue β€” return the string value of the specified column. Periodt. ✨

✨ SYNOPSIS ✨

char * SPI_getvalue(HeapTuple row, TupleDesc rowdesc, int colnumber)

πŸ’… DESCRIPTION πŸ’…

Okay so SPI_getvalue returns the string representation of the value of the specified column. That's the whole vibe. 🫢

The result comes back in memory allocated using palloc. (You can use pfree to release that memory when you don't need it anymore.) No cap. πŸŽ€

πŸŽ€ ARGUMENTS πŸŽ€

  • HeapTuple row β€” the input row to be examined πŸ‘€
  • TupleDesc rowdesc β€” the input row description πŸ“
  • int colnumber β€” the column number (count starts at 1) πŸ”’

🫢 RETURN VALUE 🫢

You get the column value, or NULL if any of these is true:

  • the column is null
  • colnumber is out of range (SPI_result is set to SPI_ERROR_NOATTRIBUTE)
  • no output function is available (SPI_result is set to SPI_ERROR_NOOUTFUNC)

Made with πŸ’– for PostgreSQL 13.23 Β· 2025 Β· SPI_GETVALUE(3) β€” mwah πŸ’…βœ¨

πŸ“¦ where this page comes from