Re: GUC names in messages

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: GUC names in messages
Дата
Msg-id ZWAUV4fdjFw5nWvj@paquier.xyz
обсуждение исходный текст
Ответ на Re: GUC names in messages  (Peter Smith <smithpb2250@gmail.com>)
Ответы Re: GUC names in messages  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: GUC names in messages  (Peter Smith <smithpb2250@gmail.com>)
Список pgsql-hackers
On Thu, Nov 23, 2023 at 06:27:04PM +1100, Peter Smith wrote:
> There may be some changes I've missed, but hopefully, this is a nudge
> in the right direction.

Thanks for spending some time on that.

    <para>
+    In messages containing configuration variable names, do not include quotes
+    when the names are visibly not English natural words, such as when they
+    have underscores or are all-uppercase or have mixed case. Otherwise, quotes
+    must be added.  Do include quotes in a message where an arbitrary variable
+    name is to be expanded.
+   </para>

That seems to describe clearly the consensus reached on the thread
(quotes for GUCs that are single terms, no quotes for names that are
obviously parameters).

In terms of messages that have predictible names, 0002 moves in the
needle in the right direction.  There seem to be more:
src/backend/postmaster/bgworker.c:  errhint("Consider increasing the
configuration parameter \"max_worker_processes\".")));
contrib/pg_prewarm/autoprewarm.c:  errhint("Consider increasing
configuration parameter \"max_worker_processes\".")));

Things like parse_and_validate_value() and set_config_option_ext()
include log strings about GUC and these use quotes.  Could these areas
be made smarter with a routine to check if quotes are applied
automatically when we have a "simple" GUC name, aka I guess made of
only lower-case characters?  This could be done with a islower() on
the string name, for instance.
--
Michael

Вложения

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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: [HACKERS] psql casts aspersions on server reliability
Следующее
От: Andrei Lepikhov
Дата:
Сообщение: Re: POC, WIP: OR-clause support for indexes