Postgresql 中文操作指南
SPI_rollback
SPI_rollback、SPI_rollback_and_chain — 放弃当前事务
SPI_rollback, SPI_rollback_and_chain — abort the current transaction
Description
SPI_rollback 回滚当前事务。它约等于运行 SQL 命令 ROLLBACK 。在回滚事务后,将利用默认事务特性自动开启一个新事务,以便调用者可以继续使用 SPI 功能。
SPI_rollback rolls back 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.
SPI_rollback_and_chain 相同,但是新事务的开启使用已完成事务相同的特性,类似于 SQL 命令 ROLLBACK AND CHAIN 。
SPI_rollback_and_chain is the same, but the new transaction is started with the same transaction characteristics as the just finished one, like with the SQL command ROLLBACK AND CHAIN.
只有当 SPI 连接在调用 SPI_connect_ext 中被设置为 nonatomic 时,才能执行这些功能。
These functions can only be executed if the SPI connection has been set as nonatomic in the call to SPI_connect_ext.