User-defined error messages/codes

Поиск
Список
Период
Сортировка
От Vince Gonzalez
Тема User-defined error messages/codes
Дата
Msg-id 20000127181328.E24586@newton.baruch.cuny.edu
обсуждение исходный текст
Ответы Re: [SQL] User-defined error messages/codes  (Vince Gonzalez <vince@baruch.cuny.edu>)
Список pgsql-sql
Hello,

Is it possible to create user-defined error messages in functions?
For example, I'd like for an update to a table to fail with a message like
'You need to check your privileges' as opposed to 'Permission Denied'.    
I'd like to avoid parsing the messages actually returned by the server,   
as these could change from revision to revision.  Should I do this by     
crafting each function to return an error code that I define, and then    
use that code to index a table?  I'm interested to hear any solutions     
people may have come up with.                                             

I seem to remember there being some sort of exception facility, but I
can't remember where I may have seen it (or I could be crazy).       

My application is written in Java, if that matters.

--vince



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

Предыдущее
От: Vince Gonzalez
Дата:
Сообщение: User-defined error messages
Следующее
От: Vince Gonzalez
Дата:
Сообщение: Re: [SQL] User-defined error messages/codes