SPI_COPYTUPLE(3)
π NAME π
okay bestie, this is the SPI_COPYTUPLE(3) page, straight from the PostgreSQL 17.11 docs β and the star of the show is SPI_copytuple, which makes a copy of a row in the upper executor context. iconic behavior, honestly. β¨
β¨ SYNOPSIS β¨
HeapTuple SPI_copytuple(HeapTuple row)
πΈ DESCRIPTION πΈ
okay so SPI_copytuple makes a copy of a row in the upper executor context. This is normally used to return a modified row from a trigger. main character energy, fr fr.
π¨ bestie, listen: in a function declared to return a composite type, use SPI_returntuple instead. not this one. iykyk.
vibe check: this function can only be used while connected to SPI. Otherwise, it returns NULL and sets SPI_result to SPI_ERROR_UNCONNECTED. so if you're not connected to SPI, that's the whole situation. π
π ARGUMENTS π
HeapTuple rowβ the row to be copied. that's the argument, bestie. π«Ά
π RETURN VALUE π
- the copied row, or
NULLon error (seeSPI_resultfor an error indication). slay when you get the copied row; checkSPI_resultwhen you getNULL. π
that's the whole page, no cap. ~ PostgreSQL 17.11, 2026, SPI_COPYTUPLE(3) ~ byeee πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17-docs 17.11-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