"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