Re: trap for any exception

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Sabin Coanda <sabin(dot)coanda(at)deuromedia(dot)ro>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: trap for any exception
Date: 2007-11-15 18:36:32
Message-ID: 20071115103448.S32121@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 15 Nov 2007, Sabin Coanda wrote:

> >
> > I read 37.7.5. Trapping Errors, but the syntax requires to write
> > explicitly the exception condition, and not a generic one.
> >
> > Is it possible to build a generic trap or do you know a workaround for
> > that ?
> >
> Sorry, I found the OTHERS condition that trap any error.
>
> But the question still remains to find how could I interpret it and found
> the error code and message ?

I think you'll want to look at SQLSTATE and SQLERRM inside the exception
handler.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Daniel Caune 2007-11-15 19:06:28 Erlang & PostgreSQL native driver
Previous Message Andrew Sullivan 2007-11-15 16:11:38 Re: Is there anything special about pg_dump's compression?