Re: [SQL] trap for any exception

2007-11-16 Thread Bart Degryse
I think you should carefully read what the manual tells about PL/pgSQL (http://www.postgresql.org/docs/8.2/static/plpgsql.html) and especially about Trapping Errors (http://www.postgresql.org/docs/8.2/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING). >>> Stephan Szabo <[EMAIL PR

Re: [SQL] trap for any exception

2007-11-15 Thread Sabin Coanda
> > 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

Re: [SQL] trap for any exception

2007-11-15 Thread Stephan Szabo
On Thu, 15 Nov 2007, Sabin Coanda wrote: > Hi there, > > I'd like to build a PL/pgSQL function which is able to generic trap any > error, and interpret it. > > I read 37.7.5. Trapping Errors, but the syntax requires to write explicitly > the exception condition, and not a generic one. > > Is it po

Re: [SQL] trap for any exception

2007-11-15 Thread Stephan Szabo
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

[SQL] trap for any exception

2007-11-15 Thread Sabin Coanda
Hi there, I'd like to build a PL/pgSQL function which is able to generic trap any error, and interpret it. 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 workaro

Re: [SQL] trap for any exception

2007-11-15 Thread Sabin Coanda
That's ok, I found SQLSTATE and SQLERRM. ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate