From: Tomasz Myrta <jasiek@klaster.net>
To: Peter Gabriel <Peter.Gabriel@gmx.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: handling error in a function
Date: Wed, 18 Dec 2002 11:07:22 +0100
Message-ID: <3E0048DA.3070408@klaster.net> (raw)
In-Reply-To: <29166.1040154128@www58.gmx.net>
References: <29166.1040154128@www58.gmx.net>
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
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: jasiek@klaster.net, Peter.Gabriel@gmx.de
Subject: Re: handling error in a function
In-Reply-To: <3E0048DA.3070408@klaster.net>
* 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