Re: GUC names in messages

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: GUC names in messages
Дата
Msg-id ZX1u-QVlAowc4CT2@paquier.xyz
обсуждение исходный текст
Ответ на Re: GUC names in messages  (Peter Eisentraut <peter@eisentraut.org>)
Ответы Re: GUC names in messages
Список pgsql-hackers
On Thu, Dec 14, 2023 at 09:38:40AM +0100, Peter Eisentraut wrote:
> After these discussions, I think this rule change was not a good idea. It
> effectively enforces these kinds of inconsistencies.  For example, if you
> ever refactored
>
>     "DateStyle is wrong"
>
> to
>
>     "%s is wrong"
>
> you'd need to adjust the quotes, and thus user-visible behavior, for
> entirely internal reasons.  This is not good.

So, what are you suggesting?  Should the encouraged rule be removed
from the docs?  Or do you object to some of the changes done in the
latest patch series v5?

FWIW, I am a bit meh with v5-0001, because I don't see the benefits.
On the contrary v5-0003 is useful, because it reduces a bit the number
of strings to translate.  That's always good to take.  I don't have a
problem with v5-0002, either, where we'd begin using the name of the
GUC as stored in the static tables rather than the name provided in
the SET query, particularly for the reason that it makes the GUC name
a bit more consistent even when using double-quotes around the
parameter name in the query, where the error messages would not force
a lower-case conversion.  The patch would, AFAIU, change HEAD from
that:
=# SET "intervalstylE" to popo;
ERROR:  22023: invalid value for parameter "intervalstylE": "popo"
To that:
=# SET "intervalstylE" to popo;
ERROR:  22023: invalid value for parameter "IntervalStyle": "popo"

> And then came the idea to
> determine the quoting dynamically, which I think everyone agreed was too
> much.  So I don't see a way to make this work well.

Yeah, with the quotes being language-dependent, any idea I can think
of is as good as unreliable and dead.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Remove MSVC scripts from the tree
Следующее
От: Ishaan Adarsh
Дата:
Сообщение: [DOC] Introducing Quick Start Guide to PL/pgSQL and PL/Python Documentation