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
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
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
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
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
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
Attachments:
guc_message_levels.patchtext/x-diff; name=guc_message_levels.patchDownload+40-23
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
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