From: Forest Wilkinson <fspam@home.com>
To: pgsql-sql@hub.org
Subject: transactions surrounding extension functions
Date: Thu, 28 Sep 2000 11:30:20 -0700
Message-ID: <ts27ts498olm1t3btnddev9kss00etofn5@4ax.com> (raw)
According to the postgres 7 docs:
>By default, Postgres executes transactions in unchained mode (also
>known as “autocommit” in other database systems). In other words, each
>user statement is executed in its own transaction and a commit is
>implicitly performed at the end of the statement (if execution was
>successful, otherwise a rollback is done).
Does this mean that when I call a function I wrote, which is composed of
several queries, each of those queries will be executed in its own
transaction? Or, will the statement containing the function call be
executed in its own transaction, thereby including all the queries
composing my function in that same transaction?
This is important when I have a function that performs a SELECT...FOR
UPDATE, followed by an UPDATE to the selected rows. If I call that
function without surrounding it with BEGIN and END, the former behavior
would be dangerous, while the latter behavior would be desirable.
Thanks,
Forest Wilkinson
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-sql@postgresql.org
Cc: fspam@home.com, pgsql-sql@hub.org
Subject: Re: transactions surrounding extension functions
In-Reply-To: <ts27ts498olm1t3btnddev9kss00etofn5@4ax.com>
References: <ts27ts498olm1t3btnddev9kss00etofn5@4ax.com>
* 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