Re: handling error in a function

Поиск
Список
Период
Сортировка
От Tomasz Myrta
Тема Re: handling error in a function
Дата
Msg-id 3E0048DA.3070408@klaster.net
обсуждение исходный текст
Ответ на handling error in a function  (Peter Gabriel <Peter.Gabriel@gmx.de>)
Список 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 по дате отправления:

Предыдущее
От: Christoph Haller
Дата:
Сообщение: Re: handling error in a function
Следующее
От: Christoph Haller
Дата:
Сообщение: Re: Dynamic sql program using libpq