From paolo@ecometer.it Thu May 24 06:53:34 2007 Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id CB02A9FBD78 for ; Thu, 24 May 2007 03:53:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 76543-05 for ; Thu, 24 May 2007 03:53:27 -0300 (ADT) X-Greylist: delayed 00:06:07.753121 by SQLgrey-1.7.5 Received: from MTA006E.interbusiness.it (MTA006E.interbusiness.it [88.44.62.6]) by postgresql.org (Postfix) with ESMTP id 3F9299FBC71 for ; Thu, 24 May 2007 03:53:29 -0300 (ADT) Received: from host213-103.pool8290.interbusiness.it (HELO dell370) ([82.90.103.213]) by ibs10.interbusiness.it with ESMTP; 24 May 2007 08:44:18 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAEjRVEZSWmfV/2dsb2JhbACCdIge From: "Paolo Saudin" To: References: <3650d0d50705152242y689c0ef8u56223ec15661c821@mail.gmail.com> <464AD62B.9000003@archonet.com> <3650d0d50705230134n15b993aat8bbc631836eef65e@mail.gmail.com> <46540766.2030108@archonet.com> <3650d0d50705230756g5fdf8bdava3de463eb6f82ad9@mail.gmail.com> <4654621C.8010700@archonet.com> <3650d0d50705232254w265b94b0yaaf5163b92567403@mail.gmail.com> In-Reply-To: <3650d0d50705232254w265b94b0yaaf5163b92567403@mail.gmail.com> Subject: Get the exeption error description Date: Thu, 24 May 2007 08:44:18 +0200 Message-ID: <002f01c79dce$f48020d0$dd806270$@it> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0030_01C79DDF.B808F0D0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcedyJAaBN+hZP5rRE62WUDmpctkNAABSH3g Content-Language: it X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.219 tagged_above=0 required=5 tests=AWL=0.290, BAYES_40=-0.185, HTML_90_100=0.113, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200705/1148 X-Sequence-Number: 114342 Messaggio multipart in formato MIME. ------=_NextPart_000_0030_01C79DDF.B808F0D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Is there a way to know the error description / message in a BEGIN END block in a plpgsql functioin as in the 'Appendix A. PostgreSQL Error Codes' ? I would like to pass it back to the function caller DECLARE the_error varchar; BEGIN .. ... ... .. ... ... EXCEPTION WHEN OTHERS THEN the_error := ERROR DESCRIPTION; ? END; Thanks, Paolo ------=_NextPart_000_0030_01C79DDF.B808F0D0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

Is there a way to know the error description / message in a BEGIN END block = in a plpgsql functioin as in the ‘Appendix A. PostgreSQL Error Codes’ = ?

I would like to pass it back to the function caller

 =

DECLARE

  the_error   varchar;      =

BEGIN<= /o:p>

  = ;            =   ……  …….   …..

  = ;            =   ……  …….   …..

 =

  = ;    EXCEPTION WHEN OTHERS THEN

the_error = :=3D  ERROR DESCRIPTION; ?

  = ;    END;

 =

Thanks,

Paolo<= /o:p>

------=_NextPart_000_0030_01C79DDF.B808F0D0-- From all@adv.magwien.gv.at Thu May 24 08:16:49 2007 Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B344C9FB8B5 for ; Thu, 24 May 2007 05:16:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 67222-07 for ; Thu, 24 May 2007 05:16:37 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from fr112.ext.magwien.gv.at (relay-fr112.magwien.gv.at [217.149.225.66]) by postgresql.org (Postfix) with ESMTP id 105279FB816 for ; Thu, 24 May 2007 05:16:40 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by fr112.ext.magwien.gv.at (Postfix) with ESMTP id 46B736EF9A; Thu, 24 May 2007 10:16:34 +0200 (CEST) Received: from exrat0.host.magwien.gv.at (exrat0.host.magwien.gv.at [10.136.132.84]) by fr112.ext.magwien.gv.at (Postfix) with ESMTP id 014DC6EF1C; Thu, 24 May 2007 10:16:30 +0200 (CEST) Received: from EXADV1.host.magwien.gv.at ([10.152.101.185]) by exrat0.host.magwien.gv.at with Microsoft SMTPSVC(6.0.3790.211); Thu, 24 May 2007 10:15:36 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: Get the exeption error description Date: Thu, 24 May 2007 10:15:41 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [GENERAL] Get the exeption error description Thread-Index: AcedyJAaBN+hZP5rRE62WUDmpctkNAABSH3gAAN7i4A= References: <3650d0d50705152242y689c0ef8u56223ec15661c821@mail.gmail.com> <464AD62B.9000003@archonet.com> <3650d0d50705230134n15b993aat8bbc631836eef65e@mail.gmail.com> <46540766.2030108@archonet.com> <3650d0d50705230756g5fdf8bdava3de463eb6f82ad9@mail.gmail.com> <4654621C.8010700@archonet.com> <3650d0d50705232254w265b94b0yaaf5163b92567403@mail.gmail.com> <002f01c79dce$f48020d0$dd806270$@it> From: "Albe Laurenz" To: "Paolo Saudin *EXTERN*" , X-OriginalArrivalTime: 24 May 2007 08:15:36.0452 (UTC) FILETIME=[B510BC40:01C79DDB] X-Virus-Scanned: by amavisd-new using Sophie and ClamAV at magwien.gv.at X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/1153 X-Sequence-Number: 114347 > Is there a way to know the error description / message in a=20 > BEGIN END block in a plpgsql functioin as in the 'Appendix A.=20 > PostgreSQL Error Codes' ? The variable SQLERRM as described in http://www.postgresql.org/docs/current/static/plpgsql-control-structures .html#PLPGSQL-ERROR-TRAPPING Yours, Laurenz Albe