Re: handling error in a function - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: handling error in a function
Date
Msg-id 3E0048DA.3070408@klaster.net
Whole thread Raw
In response to handling error in a function  (Peter Gabriel <Peter.Gabriel@gmx.de>)
List pgsql-sql
Peter Gabriel wrote:

>
> When executing this and violating that constraint (i mustn't delete that
> row), the function aborts with "unknown error" and i have no way to 
> return 0 or
> something like that.
>
> I am programming with PHP and PEAR, each time, the result set is an object
> of type error, the script jumps to an error page, to calm the angry 
> customers.

I don't know, how PHP works with Postgresql, but in psql I get such 
error, when deleting wrong row:
ERROR:  <unnamed> referential integrity violation - key in table_master 
still referenced from table_detail

Maybe it is possible some way to access this error inside PHP?

Tomasz Myrta





pgsql-sql by date:

Previous
From: Christoph Haller
Date:
Subject: Re: handling error in a function
Next
From: Christoph Haller
Date:
Subject: Re: Dynamic sql program using libpq