Get the exeption error description

From: "Paolo Saudin" <paolo(at)ecometer(dot)it>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Get the exeption error description
Date: 2007-05-24 06:44:18
Message-ID: 002f01c79dce$f48020d0$dd806270$@it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Purusothaman A 2007-05-24 07:35:27 Re: [GENERAL] OIDs - file objects, are damaged by PostgreSQL.
Previous Message Richard Huxton 2007-05-24 06:41:55 Re: [GENERAL] OIDs - file objects, are damaged by PostgreSQL.

Browse pgsql-general by date

  From Date Subject
Next Message Marek Lewczuk 2007-05-24 06:49:05 Re: the future of pljava development
Previous Message Richard Huxton 2007-05-24 06:41:55 Re: [GENERAL] OIDs - file objects, are damaged by PostgreSQL.