保存点和回滚在PostgreSQL脚本中不起作用

我在下面的pg脚本中使用保存点和回滚。 遇到错误。

错误:PL / pgSQL中不支持的事务命令

请帮助我实现这一目标。

do
$block$ 
declare
BEGIN
 perform updatecustdtls (
                  custdes               => 'initial state',custno            => 'C1122',cmd       =>  TO_TIMESTAMP('11/21/2005','dd/mm/yyyy')::TIMESTAMP(0),);   


 savepoint updatecust;                         

update custd set custid = 9 where custno = 'C1122';


    perform updatecustdtls (
                  custdes               => 'middle state',custno            => 'C4455',cmd       =>  TO_TIMESTAMP('11/11/2006',);

rollback to updatecust;  

    perform updatecustdtls (
                  custdes               => 'final state',custno            => 'C88809',cmd       =>  TO_TIMESTAMP('08/15/2007',);

end $block$; 

谢谢。

as980427 回答:保存点和回滚在PostgreSQL脚本中不起作用

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3152528.html

大家都在问