Re: Multiple SQL statements within a function...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc Mitchell" <marcm(at)eisolution(dot)com>
Cc: "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Multiple SQL statements within a function...
Date: 2002-08-01 04:06:07
Message-ID: 4230.1028174767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Marc Mitchell" <marcm(at)eisolution(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Haroldo Stenger 2002-08-01 04:09:45 Re: Multiple SQL statements within a function...
Previous Message cyz62578800 2002-08-01 02:13:27 What&nbsp; used&nbsp; so&nbsp; many&nbsp; spaces&nbsp; in&nbsp; PostgreSQL&nbsp; data&nbsp; folder?