Re: How do BEGIN/COMMIT/ABORT operate in a nested SPI query? - Mailing list pgsql-general

From John R Pierce
Subject Re: How do BEGIN/COMMIT/ABORT operate in a nested SPI query?
Date
Msg-id 57158C7B.1080501@hogranch.com
Whole thread Raw
In response to Re: How do BEGIN/COMMIT/ABORT operate in a nested SPI query?  (<david@andl.org>)
List pgsql-general
On 4/18/2016 5:41 PM, david@andl.org wrote:
> Are you sure you meant it like that? I already have BEGIN/COMMIT inside a function and it works perfectly. If it did
not,then it would be impossible to use BEGIN/COMMIT in any language handler, since every call to a language handler is
acall to a function. 

the transaction has already been started before your function is called.

and you can not issue a COMMIT from anywhere but the top level. you CAN
have savepoints, which act something like  nested transactions within a
function.



--
john r pierce, recycling bits in santa cruz



pgsql-general by date:

Previous
From:
Date:
Subject: Re: How do BEGIN/COMMIT/ABORT operate in a nested SPI query?
Next
From: Jinhua Luo
Date:
Subject: Re: Re: what's the exact command definition in read committed isolation level?