SPI_GETVALUE(3)

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

πŸ’– NAME πŸ’–

Okay bestie, welcome to SPI_GETVALUE(3) β€” the PostgreSQL 14.24 manual page for section 3, and it's literally about one thing: SPI_getvalue returns the string value of the specified column. No cap. πŸ’…

✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So SPI_getvalue returns the string representation of the value of the specified column. It's giving β€œturn that column into a string” energy. ✨

The result comes back in memory allocated using palloc. (And yes, bestie, you can use pfree to release that memory when you don't need it anymore β€” clean up after yourself, icon behavior. 🫢)

πŸŽ€ ARGUMENTS πŸŽ€

  • HeapTuple row β€” the input row to be examined. Like, the row you're checking out. πŸ‘€
  • TupleDesc rowdesc β€” the input row description. It's the row's little ID card. πŸͺͺ
  • int colnumber β€” the column number (count starts at 1). Periodt. πŸ”’

🌈 RETURN VALUE 🌈

You get the column value back β€” or NULL if the column is null, if colnumber is out of range (in that case SPI_result is set to SPI_ERROR_NOATTRIBUTE), or if no output function is available (then SPI_result is set to SPI_ERROR_NOOUTFUNC). So NULL is doing a lot of heavy lifting here, fr fr. 😭


That's the whole page, bestie πŸ’– β€” source/version: PostgreSQL 14.24 Documentation, date: 2026, from the SPI_GETVALUE(3) manual. Now go forth and slay those column values. πŸŽ€βœ¨

πŸ“¦ where this page comes from