postgresql

1、事务的使用

begin;//开启关闭自动提交的事务

insert into testtab01 values(0);

rollback;//事务回滚

2、SavePoint的使用

begin;//开启关闭自动提交的事务

insert into testtab01 values(0);

savepoint first_savepoint;//创建事务保存点

insert into testtab02 values(1);

rollback;//事务回滚

insert into testtab02 values(1);

commit;//事务提交

原文地址:https://www.cnblogs.com/xiaofoyuan/p/5285575.html