Re: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals

Lists: pgsql-bugs
From: "thommy" <der(dot)thommy(at)gmx(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals
Date: 2010-09-14 13:13:42
Message-ID: 201009141313.o8EDDgXh093771@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5656
Logged by: thommy
Email address: der(dot)thommy(at)gmx(dot)net
PostgreSQL version: 9.0rc1
Operating system: Windows
Description: parameter 'client_min_messages' accept values not listed
in enumvals
Details:

Hi there,

I just came across a small inconsistency:

pg=# select enumvals from pg_settings where name='client_min_messages';
enumvals
---------------------------------------------------------------
{debug5,debug4,debug3,debug2,debug1,log,notice,warning,error}

Hmm, according to the documentation 'panic' is a valid value...

pg=# select set_config('client_min_messages', 'PANIC', false);
set_config
------------
panic

pg=# select name, setting, enumvals from pg_settings where
name='client_min_messages';
-[ RECORD 1 ]-----------------------------------------------------------
name | client_min_messages
setting | panic
enumvals | {debug5,debug4,debug3,debug2,debug1,log,notice,warning,error}

Maybe this can be fixed before the final release of 9.0

Regards, thommy


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "thommy" <der(dot)thommy(at)gmx(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals
Date: 2010-09-14 16:37:36
Message-ID: 7644.1284482256@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"thommy" <der(dot)thommy(at)gmx(dot)net> writes:
> I just came across a small inconsistency:

> pg=# select enumvals from pg_settings where name='client_min_messages';
> enumvals
> ---------------------------------------------------------------
> {debug5,debug4,debug3,debug2,debug1,log,notice,warning,error}

It's intentional that PANIC isn't listed there (nor is FATAL),
on the grounds that it's not really a useful setting.

regards, tom lane


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: thommy <der(dot)thommy(at)gmx(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals
Date: 2010-09-14 17:18:59
Message-ID: 4C8FAE83.4020900@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Tom Lane escreveu:
> "thommy" <der(dot)thommy(at)gmx(dot)net> writes:
>> I just came across a small inconsistency:
>
>> pg=# select enumvals from pg_settings where name='client_min_messages';
>> enumvals
>> ---------------------------------------------------------------
>> {debug5,debug4,debug3,debug2,debug1,log,notice,warning,error}
>
> It's intentional that PANIC isn't listed there (nor is FATAL),
> on the grounds that it's not really a useful setting.
>
Fine. But shouldn't we remove these options from docs and/or code?

--
Euler Taveira de Oliveira
http://www.timbira.com/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, thommy <der(dot)thommy(at)gmx(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals
Date: 2010-09-14 18:12:11
Message-ID: 201009141812.o8EICBK27530@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Euler Taveira de Oliveira wrote:
> Tom Lane escreveu:
> > "thommy" <der(dot)thommy(at)gmx(dot)net> writes:
> >> I just came across a small inconsistency:
> >
> >> pg=# select enumvals from pg_settings where name='client_min_messages';
> >> enumvals
> >> ---------------------------------------------------------------
> >> {debug5,debug4,debug3,debug2,debug1,log,notice,warning,error}
> >
> > It's intentional that PANIC isn't listed there (nor is FATAL),
> > on the grounds that it's not really a useful setting.
> >
> Fine. But shouldn't we remove these options from docs and/or code?

We are basically reusing the same validation code for this and other
min_messages settings. Is it worth creating a custom one just for
client_min_messages? Probably not.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, thommy <der(dot)thommy(at)gmx(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals
Date: 2010-09-14 18:47:15
Message-ID: 4C8FC333.3030809@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Bruce Momjian escreveu:
> We are basically reusing the same validation code for this and other
> min_messages settings.
>
No, we have two enums ({client,server}_message_level_options); I don't
understand why we should have these options in client_min_messages enum.

--
Euler Taveira de Oliveira
http://www.timbira.com/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, thommy <der(dot)thommy(at)gmx(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals
Date: 2010-09-14 18:57:00
Message-ID: 10365.1284490620@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Euler Taveira de Oliveira <euler(at)timbira(dot)com> writes:
> Bruce Momjian escreveu:
>> We are basically reusing the same validation code for this and other
>> min_messages settings.
>>
> No, we have two enums ({client,server}_message_level_options); I don't
> understand why we should have these options in client_min_messages enum.

I believe the reasoning was that we shouldn't arbitrarily refuse values
that have a legal interpretation, but that we should hide them in the
pg_settings view if they aren't especially sensible to use. You might
care to go back and consult the archives for the discussions that led up
to putting a "hidden value" feature into the guc-enum code. ISTM your
argument can be reduced to "there should be no hidden values ever", but
I doubt we're going to buy that.

regards, tom lane


From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, thommy <der(dot)thommy(at)gmx(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals
Date: 2010-09-14 22:39:24
Message-ID: 4C8FF99C.3060800@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Tom Lane escreveu:
> ISTM your
> argument can be reduced to "there should be no hidden values ever", but
> I doubt we're going to buy that.
>
No, the "hidden values" has their use case (hiding legal values that we don't
want to expose, for example, true/false, 0/1, yes/no). My point is if they are
not useful let's rip them to not confuse people.

--
Euler Taveira de Oliveira
http://www.timbira.com/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, thommy <der(dot)thommy(at)gmx(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5656: parameter 'client_min_messages' accept values not listed in enumvals
Date: 2010-09-14 23:34:24
Message-ID: 20514.1284507264@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Euler Taveira de Oliveira <euler(at)timbira(dot)com> writes:
> Tom Lane escreveu:
>> ISTM your
>> argument can be reduced to "there should be no hidden values ever", but
>> I doubt we're going to buy that.

> No, the "hidden values" has their use case (hiding legal values that we don't
> want to expose, for example, true/false, 0/1, yes/no).

Right ... that's exactly what these are, IMO.

regards, tom lane