Re: GUC values - recommended way to declare the C variables?
| От | Tom Lane |
|---|---|
| Тема | Re: GUC values - recommended way to declare the C variables? |
| Дата | |
| Msg-id | 1113448.1665717297@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: GUC values - recommended way to declare the C variables? (Peter Smith <smithpb2250@gmail.com>) |
| Ответы |
Re: GUC values - recommended way to declare the C variables?
|
| Список | pgsql-hackers |
Peter Smith <smithpb2250@gmail.com> writes:
> I agree if constants are used in both places then there will always be
> some risk they can get out of sync again.
Yeah.
> But probably it is no problem to just add #defines (e.g. in
> logicallauncher.h?) to be commonly used for the C variable declaration
> and also in the guc_tables.
The problem is exactly that there's no great place to put those #define's,
at least not without incurring a lot of fresh #include bloat.
Also, if you did it like that, then it doesn't really address Michael's
desire to see the default value in the variable declaration.
I do lean towards having the data available, mainly because of the
fear I mentioned upthread that some GUCs may be accessed before
InitializeGUCOptions runs.
Could we fix the out-of-sync risk by having InitializeGUCOptions insist
that the pre-existing value of the variable match what is in guc_tables.c?
That may not work for string values but I think we could insist on it
for other GUC data types. For strings, maybe the rule could be "the
old value must be NULL or strcmp-equal to the boot_val".
regards, tom lane
В списке pgsql-hackers по дате отправления: