From: Nathan Young <nyoung@silcom.com>
To: pgsql <pgsql-sql@postgresql.org>
Subject: transactions within stored procedures
Date: Fri, 14 Jul 2000 09:02:44 -0700
Message-ID: <396F39A4.7D4B0B69@silcom.com> (raw)
Hi.
Please correct me if this is off topic for the group. On looking
through the available postgres mailing lists, this seemed the most
appropriate for my question.
Transactions are important to my application. I was scripting in perl
with autocommit turned off, issuing commits when appropriate. As I
moved more of my logic into stored procedures, I looked for
documentation on how transactions work in stored procedures and I
couldn't find any! I'm using pl/pgsql right now but would happily use
pg/perl...
By trial and error I established that a SP wraps everything it does in
one transaction, including anything from stored procedures it calls.
So here is my question: Is there any way for me to control when
transactions are committed or rolled back within stored procedures? Is
there an equivalent to turning autocommit off, in other words doing each
statement in its own transaction? Or is there a command to let me
commit whenever I want to? Also, can I roll back a transaction based on
programmatically defined logic, or only on a database error?
Thanks in advance...
--------------------->Nathan
--
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤
Nathan Young
nathan@ncyoung.com
(805) 686-2830
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: nyoung@silcom.com
Subject: Re: transactions within stored procedures
In-Reply-To: <396F39A4.7D4B0B69@silcom.com>
References: <396F39A4.7D4B0B69@silcom.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