Re: Do Postgres exceptions rise up the stack?

From: Wiebe Cazemier <halfgaar(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Do Postgres exceptions rise up the stack?
Date: 2007-06-30 21:24:41
Message-ID: f66hmq$80s$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Saturday 30 June 2007 23:14, Postgres User wrote:

> A basic question about raising exceptions in Postgres:
>
> If Function A calls Function B
>
> and Func B raises an exception, will the exception roll back the
> transaction in Func A by default? Or do I need to trap and re-raise
> the exception in Func A?
>
> Thanks.

Any exception aborts the transaction. That's how exceptions work. If you don't
catch them, they bubble all the way to the surface. Otherwise it would be too
much like if-statement error checking.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Postgres User 2007-06-30 21:52:37 Re: Do Postgres exceptions rise up the stack?
Previous Message Postgres User 2007-06-30 21:18:56 Re: SQL problem..