ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block.

From: "Jaiswal Dhaval Sudhirkumar" <JaiswalDS(at)microland(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block.
Date: 2011-02-18 09:03:43
Message-ID: F260108AB230D44CBAA660B47CC4110A06EB9B58@blrisbe01.MLCORP.NET
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2011-02-18 13:26:01 Re: BUG #5878: BTREE_BUILD_STATS causes 'make check' to fail
Previous Message Arnd Hannemann 2011-02-18 08:48:36 postgresql 9.0.3: parallel restore fails with comments on indices