Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1E135133798E for ; Fri, 18 Feb 2011 05:14:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 69715-03 for ; Fri, 18 Feb 2011 09:14:30 +0000 (UTC) X-Greylist: delayed 00:10:27.80983 by SQLgrey-1.7.6 Received: from smtp.microland.net (smtp.microland.net [203.90.4.139]) by mail.postgresql.org (Postfix) with ESMTP id F0DB61336FA7 for ; Fri, 18 Feb 2011 05:14:29 -0400 (AST) X-IronPort-AV: E=Sophos;i="4.62,186,1297017000"; d="scan'208,217";a="11431106" Received: from unknown (HELO blrisbe01.MLCORP.NET) ([172.21.2.3]) by smtp.microland.net with ESMTP; 18 Feb 2011 14:33:58 +0530 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CBCF4A.BE11A9EC" Subject: ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block. Date: Fri, 18 Feb 2011 14:33:43 +0530 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block. Thread-Index: AcvPSr4IIQA4u6l3S6SrURbMPPjvPg== From: "Jaiswal Dhaval Sudhirkumar" To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201102/159 X-Sequence-Number: 29431 This is a multi-part message in MIME format. ------_=_NextPart_001_01CBCF4A.BE11A9EC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi List,=20 Below function throwing error when i execute it on PostgreSQL 9.0.=20 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 =20 I searched and found that it is reported to pgsql-bugs. Can you please let= me know whether this bug has fixed or not.=20 =20 CREATE OR REPLACE FUNCTION rlbk(integer) RETURNS integer AS $BODY$ DECLARE bal_amt ALIAS FOR $1; BEGIN UPDATE accounts SET balance =3D balance - bal_amt WHERE name =3D 'Axis';=20 SAVEPOINT my_savepoint;=20 UPDATE accounts SET balance =3D balance + bal_amt WHERE name =3D 'Bob';=20 ROLLBACK TO my_savepoint;=20 UPDATE accounts SET balance =3D balance + bal_amt WHERE name =3D 'Wally';=20 COMMIT; return bal_amt; end; $BODY$ LANGUAGE 'plpgsql'; =20 -- Thanks & Regards Dhaval Jaiswal |=20 The information transmitted is intended only for the person or entity to wh= ich it is addressed and may contain confidential and/or privileged material= .=20 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.=20 If you received this in error, please contact the sender and delete the mat= erial from your computer.=20 Microland takes all reasonable steps to ensure that its electronic communic= ations are free from viruses.=20 However, given Internet accessibility, the Company cannot accept liability = for any virus introduced by this e-mail or any attachment and you are advis= ed to use up-to-date virus checking software.=20 ------_=_NextPart_001_01CBCF4A.BE11A9EC Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi List,

Below function throwing error when i execute it on PostgreSQL 9.0.

<= FONT size=3D2>

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 pl= ease let me know whether this bug has fixed or not.

 

CREATE OR REPLACE FUNCTION rlbk(integer) RETURNS integer AS
$B= ODY$

DECLARE

bal_amt ALIAS FOR $1;

BEGIN

UPDATE accounts SET balance =3D balance - bal_amt WHERE name = =3D 'Axis';

SAVEPOINT my_savepoint;

UPDATE accounts SET balance =3D balance + bal_amt WHERE name = =3D 'Bob';

ROLLBACK TO my_savepoint;

UPDATE accounts SET balance =3D balance + bal_amt WHERE name = =3D '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 wh=
ich it is addressed and may contain confidential and/or privileged material=
.=20
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.=20
If you received this in error, please contact the sender and delete the mat=
erial from your computer.=20
Microland takes all reasonable steps to ensure that its electronic communic=
ations are free from viruses.=20
However, given Internet accessibility, the Company cannot accept liability =
for any virus introduced by this e-mail or any attachment and you are advis=
ed to use up-to-date virus checking software.=20
------_=_NextPart_001_01CBCF4A.BE11A9EC--