pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Get the exeption error description
2+ messages / 2 participants
[nested] [flat]

* Get the exeption error description
@ 2007-05-24 06:44 Paolo Saudin <paolo@ecometer.it>
  2007-05-24 08:15 ` Re: Get the exeption error description Albe Laurenz <all@adv.magwien.gv.at>
  0 siblings, 1 reply; 2+ messages in thread

From: Paolo Saudin @ 2007-05-24 06:44 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Get the exeption error description
  2007-05-24 06:44 Get the exeption error description Paolo Saudin <paolo@ecometer.it>
@ 2007-05-24 08:15 ` Albe Laurenz <all@adv.magwien.gv.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Albe Laurenz @ 2007-05-24 08:15 UTC (permalink / raw)
  To: Paolo Saudin *EXTERN* <paolo@ecometer.it>; pgsql-general@postgresql.org

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

The variable SQLERRM as described in

http://www.postgresql.org/docs/current/static/plpgsql-control-structures
.html#PLPGSQL-ERROR-TRAPPING

Yours,
Laurenz Albe



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-05-24 08:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-05-24 06:44 Get the exeption error description Paolo Saudin <paolo@ecometer.it>
2007-05-24 08:15 ` Albe Laurenz <all@adv.magwien.gv.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox