Re: Raise functionality

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Raise functionality
Date: 2009-11-05 14:39:34
Message-ID: 20091105143934.GS5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 05, 2009 at 08:24:24AM -0600, Michael Gould wrote:
> We want to control from our application how to handle certain exceptions. I
> believe that Raise is the functionality that we want to use. The
> documentation is a little light on what happens on the client side.

That's because it's up to the client to decide what to do. You'll need
to look at the documentation of whatever library/code you're using
to talk to PG. PG just aborts the transaction for anything apart
from NOTIFY and hence your client will just see the transaction/query
failing. How you disentangle this is up to your code and how they with
your drivers.

I'd just write a plpgsql function that raises an error, call it from
your code, and see what happens.

--
Sam http://samason.me.uk/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-11-05 14:44:58 Re: How can I pass an array to SPI_execute_with_args()?
Previous Message Michael Gould 2009-11-05 14:24:24 Raise functionality