Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 793A7475A72 for ; Thu, 1 Aug 2002 00:06:25 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g71467Vk004231; Thu, 1 Aug 2002 00:06:07 -0400 (EDT) To: "Marc Mitchell" Cc: "pgsql-admin" Subject: Re: Multiple SQL statements within a function... In-reply-to: <00e101c238cf$d03dec20$3c0aa8c0@nmtransfer.com> References: <1028144000.25315.52.camel@linda> <00e101c238cf$d03dec20$3c0aa8c0@nmtransfer.com> Comments: In-reply-to "Marc Mitchell" message dated "Wed, 31 Jul 2002 15:21:05 -0500" Date: Thu, 01 Aug 2002 00:06:07 -0400 Message-ID: <4230.1028174767@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200208/1 X-Sequence-Number: 5116 "Marc Mitchell" 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