From: Jaiswal Dhaval Sudhirkumar <JaiswalDS@microland.com>
To: pgsql-bugs@postgresql.org
Subject: ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block.
Date: Fri, 18 Feb 2011 14:33:43 +0530
Message-ID: <F260108AB230D44CBAA660B47CC4110A06EB9B58@blrisbe01.MLCORP.NET> (raw)
Hi List,
Below function throwing error when i execute it on PostgreSQL 9.0.
ERROR: SPI_execute_plan_with_paramlist failed executing query "SAVEPOINT my_savepoint": SPI_ERROR_TRANSACTION
CONTEXT: PL/pgSQL function "rlbk" line 5 at SQL statement
I searched and found that it is reported to pgsql-bugs. Can you please let me know whether this bug has fixed or not.
CREATE OR REPLACE FUNCTION rlbk(integer) RETURNS integer AS
$BODY$
DECLARE
bal_amt ALIAS FOR $1;
BEGIN
UPDATE accounts SET balance = balance - bal_amt WHERE name = 'Axis';
SAVEPOINT my_savepoint;
UPDATE accounts SET balance = balance + bal_amt WHERE name = 'Bob';
ROLLBACK TO my_savepoint;
UPDATE accounts SET balance = balance + bal_amt WHERE name = 'Wally';
COMMIT;
return bal_amt;
end;
$BODY$
LANGUAGE 'plpgsql';
--
Thanks & Regards
Dhaval Jaiswal |
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.
Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon,this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender and delete the material from your computer.
Microland takes all reasonable steps to ensure that its electronic communications are free from viruses.
However, given Internet accessibility, the Company cannot accept liability for any virus introduced by this e-mail or any attachment and you are advised to use up-to-date virus checking software.
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-bugs@postgresql.org
Cc: JaiswalDS@microland.com
Subject: Re: ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block.
In-Reply-To: <F260108AB230D44CBAA660B47CC4110A06EB9B58@blrisbe01.MLCORP.NET>
References: <F260108AB230D44CBAA660B47CC4110A06EB9B58@blrisbe01.MLCORP.NET>
* 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