From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marc Mitchell <marcm@eisolution.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Multiple SQL statements within a function...
Date: Thu, 01 Aug 2002 00:06:07 -0400
Message-ID: <4230.1028174767@sss.pgh.pa.us> (raw)
In-Reply-To: <00e101c238cf$d03dec20$3c0aa8c0@nmtransfer.com>
References: <A799F7647794D311924A005004ACEA97080DDEF2@cprodamibs249.prodam>
<1028144000.25315.52.camel@linda>
<00e101c238cf$d03dec20$3c0aa8c0@nmtransfer.com>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, marcm@eisolution.com
Subject: Re: Multiple SQL statements within a function...
In-Reply-To: <4230.1028174767@sss.pgh.pa.us>
References: <A799F7647794D311924A005004ACEA97080DDEF2@cprodamibs249.prodam> <1028144000.25315.52.camel@linda> <00e101c238cf$d03dec20$3c0aa8c0@nmtransfer.com> <4230.1028174767@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox