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--