Postgresql 中文操作指南
SPI_commit
SPI_commit,SPI_commit_and_chain — 提交当前事务
SPI_commit, SPI_commit_and_chain — commit the current transaction
Description
SPI_commit 提交当前事务。它大约相当于运行 SQL 命令 COMMIT 。事务提交后,系统会使用默认事务特性自动启动一个新事务,以便调用者能够继续使用 SPI 设施。如果在提交过程中发生故障,当前事务将回滚,并启动一个新事务,然后以通常的方式抛出错误。
SPI_commit commits the current transaction. It is approximately equivalent to running the SQL command COMMIT. After the transaction is committed, a new transaction is automatically started using default transaction characteristics, so that the caller can continue using SPI facilities. If there is a failure during commit, the current transaction is instead rolled back and a new transaction is started, after which the error is thrown in the usual way.
SPI_commit_and_chain 与上述情况相同,但新事务将使用刚刚结束的事务相同的特性启动,就像 SQL 命令 COMMIT AND CHAIN 一样。
SPI_commit_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 COMMIT 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.