Re: How do BEGIN/COMMIT/ABORT operate in a nested SPI query?

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How do BEGIN/COMMIT/ABORT operate in a nested SPI query?
Date: 2016-04-19 01:40:11
Message-ID: 57158C7B.1080501@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/18/2016 5:41 PM, david(at)andl(dot)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 a call 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jinhua Luo 2016-04-19 03:41:23 Re: Re: what's the exact command definition in read committed isolation level?
Previous Message david 2016-04-19 00:41:15 Re: How do BEGIN/COMMIT/ABORT operate in a nested SPI query?