Re: Remove redundant extra_desc info for enum GUC variables?

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Remove redundant extra_desc info for enum GUC variables?
Date: 2008-05-26 19:56:48
Message-ID: 28724.1211831808@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Most of the GUC variables that have been converted to enums have an
extra_desc string that lists the valid values --- in HEAD, try
SELECT name,extra_desc,enumvals from pg_settings where vartype = 'enum';

ISTM this is just about 100% redundant with the enumvals column and
should be removed to reduce translation and maintenance effort.
Any objections?

One point of interest is that for client_min_messages and
log_min_messages, the ordering of the values has significance, and it's
different for the two cases. The enum patch has lost that info by
trying to use the same auxiliary list for both variables. But having
two lists doesn't seem like an excessive amount of overhead.

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Remove redundant extra_desc info for enum GUC variables?
Date: 2008-05-27 18:19:20
Message-ID: 20080527201920.7bbf4992@mha-laptop.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Most of the GUC variables that have been converted to enums have an
> extra_desc string that lists the valid values --- in HEAD, try
> SELECT name,extra_desc,enumvals from pg_settings where vartype =
> 'enum';
>
> ISTM this is just about 100% redundant with the enumvals column and
> should be removed to reduce translation and maintenance effort.
> Any objections?

No, seems like the correct thing to do.

> One point of interest is that for client_min_messages and
> log_min_messages, the ordering of the values has significance, and
> it's different for the two cases. The enum patch has lost that info
> by trying to use the same auxiliary list for both variables. But
> having two lists doesn't seem like an excessive amount of overhead.

Is there any actual reason why they're supposed to be treated
differently?

//Magnus


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Remove redundant extra_desc info for enum GUC variables?
Date: 2008-05-27 18:24:44
Message-ID: 6998.1211912684@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> One point of interest is that for client_min_messages and
>> log_min_messages, the ordering of the values has significance, and
>> it's different for the two cases.

> Is there any actual reason why they're supposed to be treated
> differently?

Yeah: LOG level sorts differently in the two cases; it's fairly high
priority for server log output and much lower for client output.

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Remove redundant extra_desc info for enum GUC variables?
Date: 2008-05-28 09:10:10
Message-ID: 20080528111010.0e94fff1@mha-laptop.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> >> One point of interest is that for client_min_messages and
> >> log_min_messages, the ordering of the values has significance, and
> >> it's different for the two cases.
>
> > Is there any actual reason why they're supposed to be treated
> > differently?
>
> Yeah: LOG level sorts differently in the two cases; it's fairly high
> priority for server log output and much lower for client output.

Ok, easy fix if we break them apart. Should we continue to accept
values that we're not going to care about, or should I change that at
the same time? (for example, client_min_messages doesn't use INFO,
but we do accept that in <= 8.3 anyway)

//Magnus


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove redundant extra_desc info for enum GUC variables?
Date: 2008-05-28 15:20:04
Message-ID: 28891.1211988004@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> Tom Lane wrote:
>> Yeah: LOG level sorts differently in the two cases; it's fairly high
>> priority for server log output and much lower for client output.

> Ok, easy fix if we break them apart. Should we continue to accept
> values that we're not going to care about, or should I change that at
> the same time? (for example, client_min_messages doesn't use INFO,
> but we do accept that in <= 8.3 anyway)

I'd be inclined to keep the actual behavior the same as it was.
We didn't document INFO for this variable, perhaps, but it's accepted
and has a well-defined behavior.

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove redundant extra_desc info for enum GUC variables?
Date: 2008-06-30 19:58:55
Message-ID: 48693AFF.9010900@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Tom Lane wrote:
>>> Yeah: LOG level sorts differently in the two cases; it's fairly high
>>> priority for server log output and much lower for client output.
>
>> Ok, easy fix if we break them apart. Should we continue to accept
>> values that we're not going to care about, or should I change that at
>> the same time? (for example, client_min_messages doesn't use INFO,
>> but we do accept that in <= 8.3 anyway)
>
> I'd be inclined to keep the actual behavior the same as it was.
> We didn't document INFO for this variable, perhaps, but it's accepted
> and has a well-defined behavior.

Sorry for not getting back to this one sooner, it ended up in the wrong
end of the queue.

Does this patch look like what you meant? It should split them apart,
and it also hides the undocumented levels, but still accept it (now that
we have the ability to hide GUC vars)

//Magnus

Attachment Content-Type Size
guc_message_levels.patch text/x-diff 3.7 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove redundant extra_desc info for enum GUC variables?
Date: 2008-06-30 20:25:00
Message-ID: 4701.1214857500@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> Does this patch look like what you meant? It should split them apart,
> and it also hides the undocumented levels, but still accept it (now that
> we have the ability to hide GUC vars)

Seems reasonable, although I'm still dissatisfied with the handling of
the "debug" alias for debug2. I think if it's not hidden then it has
to be placed in correct sort position. Since it's not documented in
config.sgml, I think marking it hidden would be fine.

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove redundant extra_desc info for enum GUC variables?
Date: 2008-06-30 20:27:41
Message-ID: 486941BD.5000807@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Does this patch look like what you meant? It should split them apart,
>> and it also hides the undocumented levels, but still accept it (now that
>> we have the ability to hide GUC vars)
>
> Seems reasonable, although I'm still dissatisfied with the handling of
> the "debug" alias for debug2. I think if it's not hidden then it has
> to be placed in correct sort position. Since it's not documented in
> config.sgml, I think marking it hidden would be fine.

Good point, and thanks for the quick review. Will fix and apply.

//Magnus