Re: Multiple SQL statements within a function... - Mailing list pgsql-admin

From Tom Lane
Subject Re: Multiple SQL statements within a function...
Date
Msg-id 4230.1028174767@sss.pgh.pa.us
Whole thread Raw
In response to Multiple SQL statements within a function...  ("Marc Mitchell" <marcm@eisolution.com>)
Responses Re: Multiple SQL statements within a function...
List pgsql-admin
"Marc Mitchell" <marcm@eisolution.com> writes:
> If you have multiple SQL statements within a single SQL or PL/PGSQL
> function, are they automatically treated as a single multi-statement
> transaction

Yes.  The function is necessarily invoked within an interactive query
(SELECT, UPDATE, or whatever) and that establishes the transaction
context.  The function cannot create a transaction boundary, because
doing so would break whatever query it was called from.

            regards, tom lane

pgsql-admin by date:

Previous
From: Ludwig Lim
Date:
Subject: Re: Multiple SQL statements within a function...
Next
From: Haroldo Stenger
Date:
Subject: Re: Multiple SQL statements within a function...