Get the exeption error description - Mailing list pgsql-general

From Paolo Saudin
Subject Get the exeption error description
Date
Msg-id 002f01c79dce$f48020d0$dd806270$@it
Whole thread Raw
In response to Re: OIDs - file objects, are damaged by PostgreSQL.  ("Purusothaman A" <purusothaman.a@gmail.com>)
List 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

pgsql-general by date:

Previous
From: Marek Lewczuk
Date:
Subject: Re: the future of pljava development
Next
From: Marek Lewczuk
Date:
Subject: Re: the future of pljava development