Catching internal error ID's to throw custom errors. Is it possib le in PostGreSQL?

Поиск
Список
Период
Сортировка
От Stefan.Ardeleanu@siveco.ro
Тема Catching internal error ID's to throw custom errors. Is it possib le in PostGreSQL?
Дата
Msg-id E383500F7C4E70448157685481BF824801ACAF92@internets3.main.siveco.ro
обсуждение исходный текст
Ответы Re: Catching internal error ID's to throw custom errors.  (Richard Huxton <dev@archonet.com>)
Список pgsql-general

I have a lot of plpgsql functions and I would like to catch the original postgresql error and, based on that value, to throw with a raise or something my custom error. In SQL Server, for example, I have the sysmessages table in which I have all the possible values if the original errors. I catch that value (named @@error) and I call a function who have a parameter this value and who will return my custom value. This kind of error treatment permit me to have the same error ID's in Oracle, SQL Server and DB2, using a raise with the same error value. Is it possible to do the same in PostGreSQL using plpgsql language.

Thanks in advanced.

Stefan Ardeleanu
Database Expert / Business Analyst
SIVECO Romania SA

Business Address:       8-10 Bd. Mareşal Averescu
71316  Bucureşti, Sector 1, România
Web: http://www.siveco.ro

Business 1:    +40 (21) 224 2531
Business 2:    +40 (21) 224 2577
Business Fax:  +40 (21) 224 4108

В списке pgsql-general по дате отправления:

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Re: Simple client messages from within pgPL/SQL
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Catching internal error ID's to throw custom errors.