postgresql中的一个会话中有多个事务?

postgresql中的一个会话中有多个事务?,postgresql,Postgresql,是否可以在postgresql中的一个会话中运行/创建多个事务 BEGIN transaction; --tran1 update table set b=1; BEGIN transaction; --tran2 update table set b=2; COMMIT transaction; COMMIT transaction; 是的,这叫做: 是的,这叫做: 也许应该注意,回滚主事务将自动回滚子事务。与tsql不同,“begin”和“begin transaction”

是否可以在postgresql中的一个会话中运行/创建多个事务

BEGIN transaction; --tran1
update  table set b=1; 


BEGIN transaction;  --tran2
update  table set b=2;

COMMIT transaction;
COMMIT transaction;
是的,这叫做:

是的,这叫做:


也许应该注意,回滚主事务将自动回滚子事务。与tsql不同,“begin”和“begin transaction”是postgresql的同一语句?是否正确?@ArcilTralleis:请检查手册:答案是YesPerhaps。应该注意,回滚主事务将自动回滚子事务。与tsql不同,“begin”和“begin transaction”是postgresql的同一语句?是否正确?@ArcilTralleis:请检查手册:答案是肯定的
BEGIN;
    update  table set b=1; 
    SAVEPOINT my_savepoint;
    update  table set b=2;
    RELEASE SAVEPOINT my_savepoint;
COMMIT;