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 via email to