Re: PL/pgSQL, RAISE and error context

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: PL/pgSQL, RAISE and error context
Дата
Msg-id CAFj8pRCTzjKW=F74riBb1qfB6cgw9sbZZHO-uMvmO6xQf9a03g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PL/pgSQL, RAISE and error context  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: PL/pgSQL, RAISE and error context  (Joel Jacobson <joel@trustly.com>)
Re: PL/pgSQL, RAISE and error context  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Список pgsql-hackers
Hi

I reduced this patch, little bit cleaned - now it is based on plpgsql GUC display_context_min_messages - like client_min_messages, log_min_messages.

Documentation added.

Regards

Pavel

2015-04-25 22:23 GMT+02:00 Pavel Stehule <pavel.stehule@gmail.com>:
Hi

2015-04-24 19:16 GMT+02:00 Joel Jacobson <joel@trustly.com>:
On Fri, Apr 24, 2015 at 6:07 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>> Example:
>>
>> context_messages = -warning, -error, +notice
>
>
> I prefer your first proposal - and there is a precedent for plpgsql -
> plpgsql_extra_checks
>
> It is clean for anybody. +-identifiers looks like horrible httpd config. :)

I have to agree on that :) Just thought this is the best we can do if
we want to reduce the number of GUCs to a minimum.

I played with some prototype and I am thinking so we need only one GUC

plpgsql.display_context_messages = 'none'; -- compatible with current
plpgsql.display_context_messages = 'all';
plpgsql.display_context_messages = 'exception, log'; -- what I prefer

I implemented [ (WITH|WITHOUT) CONTEXT ] clause for RAISE statement

RAISE NOTICE WITH CONTEXT 'some message';
RAISE NOTICE WITH CONTEXT USING message = 'some message';
RAISE EXCEPTION WITHOUT CONTEXT 'other message';

The patch is very small with full functionality (without documentation) - I am thinking so it can work. This patch is back compatible - and allow to change default behave simply.

plpgsql.display_context_messages can be simplified to some like plpgsql.display_context_min_messages

What do you think about it?

Regards

Pavel


Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: forward vs backward slashes in msvc build code
Следующее
От: Andres Freund
Дата:
Сообщение: Re: inherit support for foreign tables