Unix Technical Forum

Remove redundant extra_desc info for enum GUC variables?

This is a discussion on Remove redundant extra_desc info for enum GUC variables? within the pgsql Hackers forums, part of the PostgreSQL category; --> Most of the GUC variables that have been converted to enums have an extra_desc string that lists the valid ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-29-2008, 09:43 AM
Tom Lane
 
Posts: n/a
Default Remove redundant extra_desc info for enum GUC variables?

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-29-2008, 09:43 AM
Magnus Hagander
 
Posts: n/a
Default Re: Remove redundant extra_desc info for enum GUCvariables?

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-29-2008, 09:43 AM
Tom Lane
 
Posts: n/a
Default Re: Remove redundant extra_desc info for enum GUC variables?

Magnus Hagander <magnus@hagander.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-29-2008, 09:43 AM
Magnus Hagander
 
Posts: n/a
Default Re: Remove redundant extra_desc info for enum GUCvariables?

Tom Lane wrote:
> Magnus Hagander <magnus@hagander.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-29-2008, 09:43 AM
Tom Lane
 
Posts: n/a
Default Re: Remove redundant extra_desc info for enum GUC variables?

Magnus Hagander <magnus@hagander.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-01-2008, 07:10 AM
Magnus Hagander
 
Posts: n/a
Default Re: Remove redundant extra_desc info for enum GUC variables?

Tom Lane wrote:
> Magnus Hagander <magnus@hagander.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



--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-01-2008, 07:10 AM
Tom Lane
 
Posts: n/a
Default Re: Remove redundant extra_desc info for enum GUC variables?

Magnus Hagander <magnus@hagander.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-01-2008, 07:10 AM
Magnus Hagander
 
Posts: n/a
Default Re: Remove redundant extra_desc info for enum GUC variables?

Tom Lane wrote:
> Magnus Hagander <magnus@hagander.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:14 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com