proposal: use errcontext for custom exception too

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема proposal: use errcontext for custom exception too
Дата
Msg-id CAFj8pRCxveO8OCU3Bmny327tN9P8JyH81-mB-9Dnx3TvFJZM-g@mail.gmail.com
обсуждение исходный текст
Ответы Re: proposal: use errcontext for custom exception too  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hello

There are small issue in PL/pgSQL and custom exceptions. Custom
exception doesn't set a CONTEXT field. I propose change this behave
for WARNING or EXCEPTION level. The goal is same behave for custom
exception and builtin exception and it can help to identify a RAISE
statement that is responsible to exception.


./pl_exec.c
*** ./pl_exec.c.orig    2011-11-24 17:29:08.000000000 +0100
--- ./pl_exec.c    2011-11-24 18:23:51.513136718 +0100
***************
*** 2827,2833 ****
      /*
       * Throw the error (may or may not come back)
       */
!     estate->err_text = raise_skip_msg;    /* suppress traceback of raise */

      ereport(stmt->elog_level,
              (err_code ? errcode(err_code) : 0,
--- 2827,2834 ----
      /*
       * Throw the error (may or may not come back)
       */
!     if (stmt->elog_level < WARNING)
!         estate->err_text = raise_skip_msg;    /* suppress traceback of raise notice */

      ereport(stmt->elog_level,
              (err_code ? errcode(err_code) : 0,

Regards

Pavel Stehule

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Time bug with small years
Следующее
От: Mikko Tiihonen
Дата:
Сообщение: Re: [JDBC] Optimize postgres protocol for fixed size arrays