SPI_ROLLBACK(3)

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

πŸ’… SPI_ROLLBACK(3) β€” PostgreSQL 16.15 Documentation

okay bestie, welcome to the SPI_ROLLBACK(3) page β€” transaction rollback edition, but make it cute ✨

πŸŽ€ NAME πŸŽ€

SPI_rollback, SPI_rollback_and_chain β€” abort the current transaction πŸ™…β€β™€οΈπŸ’₯

🌸 SYNOPSIS 🌸

void SPI_rollback(void)

void SPI_rollback_and_chain(void)

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so SPI_rollback is the β€œnope, undo that” button for the current transaction πŸ’… It is approximately equivalent to running the SQL command ROLLBACK. After the transaction is rolled back, a new transaction is automatically started using default transaction characteristics, so that the caller can continue using SPI facilities. Slay β€” the caller gets to keep doing SPI things 🫢

SPI_rollback_and_chain is the same deal, but the new transaction is started with the same transaction characteristics as the just finished one, like with the SQL command ROLLBACK AND CHAIN. Iconic chain-reaction behavior, no cap ✨

🚨 Important vibe check: these functions can only be executed if the SPI connection has been set as nonatomic in the call to SPI_connect_ext. That’s the requirement, periodt.

mwah πŸ’‹ β€” this page is from PostgreSQL 16.15, dated 2026, and the man page is SPI_ROLLBACK(3) 🫢✨

πŸ“¦ where this page comes from