Re: GUC values - recommended way to declare the C variables?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: GUC values - recommended way to declare the C variables?
Дата
Msg-id 1119172.1665720422@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: GUC values - recommended way to declare the C variables?  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: GUC values - recommended way to declare the C variables?  (Peter Smith <smithpb2250@gmail.com>)
Список pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Thu, Oct 13, 2022 at 11:14:57PM -0400, Tom Lane wrote:
>> For strings, maybe the rule could be "the
>> old value must be NULL or strcmp-equal to the boot_val".

> pg_strcasecmp()'d would be more flexible here?

Don't see the point for that.  The case we're talking about is
where the variable is declared like

char *my_guc_variable = "foo_bar";

where the initialization value is going to be a compile-time
constant.  I don't see why we'd need to allow any difference
between that constant and the one used in guc_tables.c.

On the other hand, we could insist that string values be strcmp-equal with
no allowance for NULL.  But that probably results in duplicate copies of
the string constant, and I'm not sure it buys anything in most places.
Allowing NULL doesn't seem like it creates any extra hazard for early
references, because they'd just crash if they try to use the value
while it's still NULL.

            regards, tom lane



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: GUC values - recommended way to declare the C variables?
Следующее
От: Richard Guo
Дата:
Сообщение: Re: Fix error message for MERGE foreign tables