Re: vacuum_truncate configuration parameter and isset_offset
| От | Nathan Bossart |
|---|---|
| Тема | Re: vacuum_truncate configuration parameter and isset_offset |
| Дата | |
| Msg-id | Z-G619dWopz6HOog@nathan обсуждение исходный текст |
| Ответ на | Re: vacuum_truncate configuration parameter and isset_offset (Nikolay Shaplov <dhyan@nataraj.su>) |
| Ответы |
Re: vacuum_truncate configuration parameter and isset_offset
|
| Список | pgsql-hackers |
On Mon, Mar 24, 2025 at 10:35:41PM +0300, Nikolay Shaplov wrote:
> We can have isset_offset, but then we have redesign all options with
> custom unset behavior to use it, instead of unreachable default value.
> This will make it consistent then.
I don't see any reason why we are compelled to redesign all such options,
but in any case, I would think that would be preferable to magic special
values. For example,
/* -1 is used to disable max threshold */
vac_max_thresh = (relopts && relopts->vacuum_max_threshold >= -1)
? relopts->vacuum_max_threshold
: autovacuum_vac_max_thresh;
would become something like
if (relopts && relopts->vacuum_max_threshold_set)
vac_max_thresh = relopts->vacuum_max_threshold;
else
vac_max_thresh = autovacuum_vac_max_thresh;
The former requires you to know that the reloption defaults to -2 if not
set, which does not seem particularly obvious to me. At least, I did not
find this out-of-range reloption default technique obvious when I was
working on autovacuum_vacuum_max_threshold.
But again, I don't see any strong reason why we must change all such
reloptions.
--
nathan
В списке pgsql-hackers по дате отправления: