Re: plpgsql.warn_shadow

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: plpgsql.warn_shadow
Дата
Msg-id 48607C95-4CC6-4041-B849-F17A8073F072@phlo.org
обсуждение исходный текст
Ответ на Re: plpgsql.warn_shadow  (Marko Tiikkaja <marko@joh.to>)
Список pgsql-hackers
On Jan15, 2014, at 10:08 , Marko Tiikkaja <marko@joh.to> wrote:
> On 1/15/14 7:07 AM, Florian Pflug wrote:
>> On Jan15, 2014, at 01:34 , Marko Tiikkaja <marko@joh.to> wrote:
>>> It's me again, trying to find a solution to the most common mistakes I make.  This time it's accidental shadowing
ofvariables, especially input variables.  I've wasted several hours banging my head against the wall while shouting
"HOWCAN THIS VARIABLE ALWAYS BE NULL?".  I can't believe I'm the only one.  To give you a rough idea on how it works: 
>>
>> I like this, but think that the option should be just called plpgsql.warnings or plpgsql.warn_on and accept a list
ofwarnings to enable. 
>
> Hmm.  How about:
>
>  plpgsql.warnings = 'all' # enable all warnings, defauls to the empty list, i.e. no warnings
>  plpgsql.warnings = 'shadow, unused' # enable just "shadow" and "unused" warnings

Looks good. For the #-directive, I think what we'd actually want there is to *disable* certain warnings for certain
functions,i.e. "#silence_warning shadow" would disable the shadow warning. Enabling on a per-function basis doesn't
seemall that useful - usually you'd develop with all warnings globally enabled anyway. 

>  plpgsql.warnings_as_errors = on # defaults to off?

This I object to, for the same reasons I object to consistent_into.

best regards,
Florian Pflug




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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance
Следующее
От: Florian Pflug
Дата:
Сообщение: Re: plpgsql.warn_shadow