From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Sabin Coanda <sabin.coanda@deuromedia.ro>
Cc: pgsql-sql@postgresql.org
Subject: Re: trap for any exception
Date: Thu, 15 Nov 2007 10:36:32 -0800 (PST)
Message-ID: <20071115103448.S32121@megazone.bigpanda.com> (raw)
In-Reply-To: <fhhits$1ico$1@news.hub.org>
References: <fhhihd$1h5j$1@news.hub.org>
<fhhits$1ico$1@news.hub.org>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone.bigpanda.com, sabin.coanda@deuromedia.ro
Subject: Re: trap for any exception
In-Reply-To: <20071115103448.S32121@megazone.bigpanda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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