云数据库 GAUSSDB-COMMIT PREPARED:示例

时间:2025-03-03 09:51:23

示例

--开始。
openGauss=# begin;

--准备标识符为的trans_test的事务。
openGauss=# PREPARE TRANSACTION 'trans_test';

--创建表。
openGauss=# CREATE TABLE item1(id int);

--提交标识符为的trans_test的事务。
openGauss=# COMMIT PREPARED 'trans_test';

--删除表。
openGauss=# DROP TABLE item1;
support.huaweicloud.com/centralized-devg-v2-gaussdb/gaussdb_42_0397.html