SPI_COPYTUPLE(3)

✨ SPI_copytuple(3) ✨

okay so bestie, this is the PostgreSQL 18.6 Documentation page for SPI_copytuple(3), and she's here to copy a row. no cap. let's go 🫢


πŸŽ€ NAME πŸŽ€

SPI_copytuple β€” make a copy of a row in the upper executor context.

πŸ¦‹ SYNOPSIS πŸ¦‹

HeapTuple SPI_copytuple(HeapTuple row)

πŸ’– DESCRIPTION πŸ’–

SPI_copytuple makes a copy of a row in the upper executor context. That's literally her whole thing. This is normally used to return a modified row from a trigger. In a function declared to return a composite type, use SPI_returntuple instead.

Important bestie: This function can only be used while connected to SPI. Otherwise, it returns NULL and sets SPI_result to SPI_ERROR_UNCONNECTED.

πŸ“ ARGUMENTS πŸ“

  • HeapTuple row β€” row to be copied

🌈 RETURN VALUE 🌈

the copied row, or NULL on error (see SPI_result for an error indication)


and that's the whole vibe πŸ’… mwah! this page is from PostgreSQL 18.6, dated 2026. now go return that modified row from a trigger, bestie 🫢✨