Re: User's exception plpgsql

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: User's exception plpgsql
Дата
Msg-id Pine.LNX.4.44.0507061919410.23774-100000@kix.fsv.cvut.cz
обсуждение исходный текст
Ответ на Re: User's exception plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
On Wed, 6 Jul 2005, Tom Lane wrote:

> Pavel Stehule <stehule@kix.fsv.cvut.cz> writes:
> > if I use registered sqlstate, plpgsql knows text message.
>
> No, it does not.  I already pointed out that tying a single error
> message to a SQLSTATE is unreasonable, because that's not how the
> SQL committee intended SQLSTATEs to be used.  I haven't looked at
> this patch yet, but if it's doing things that way it is wrong.
>
no, raise stmt still needs message text (patch)

>             regards, tom lane
>

What I wont. Maybe I going in wrong direction. Please, correct me. User's
exception needs and will needs message text. I don't wont to introduce
wrong programming style. But if I use exception variable and have to use
its, then there is not only SQLSTATE but there exist name of exception
too. But I wont to simplify using system's exception. The system knows all
what need: name, text, sqlstate. And in mostly time I don't wont to
substitute text of system message. But if I wont to show it, I have to
copy it.

example:

raise exception div_by_zero; -- I wont to use system message, why not?

but now, I have to do
raise exception div_by_zero, 'division by zero ...'


Regards
Pavel


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: User's exception plpgsql
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: User's exception plpgsql