Search Postgresql Archives

Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> xof@xxxxxxxxxxxx wrote:
> 
>> s_ravikrishna@xxxxxxx wrote:
>> 
>> I am getting error at COMMIT -> cannot commit while a subtransaction is active...
> 
> You can commit in a loop, but not in BEGIN / END block that has an exception handler: that creates a subtransaction for the duration of the BEGIN / END.

This surprised me when I first started to use PG (after all those years with ORCL). There are some use cases where this limitation is a nuisance. For example, if you want to implement the famous retry loop (with exponential backoff) for an error that is provoked at commit time... well, you have to do it in client-side code.

Could the limitation be lifted by making tractable internal implementation changes? Or is it rooted in profoundly deep features of the architecture—meaning that it could never be lifted?





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux