From: | Nikolay Shaplov <dhyan(at)nataraj(dot)su> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Nathan Bossart <nathandbossart(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Robert Treat <rob(at)xzilla(dot)net>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Albe <laurenz(dot)albe(at)cybertec(dot)at>, Gurjeet Singh <gurjeet(at)singh(dot)im>, Will Storey <will(at)summercat(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Re: vacuum_truncate configuration parameter and isset_offset |
Date: | 2025-03-24 17:57:39 |
Message-ID: | 4435763.AJdgDx1Vlc@thinkpad-pgpro |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
В письме от понедельник, 24 марта 2025 г. 20:37:50 MSK пользователь David G.
Johnston написал:
> My main concern when first seeing this was adding an integer to every
> single option in the entire system for something that is going to be zero
> 99.9% of the time. A bit bloated but not directly impacting behavior.
That is 100% true.
> I wanted to avoid that by just looking in pg_class.reloptions for the
> vacuum_truncate setting when needed.
This goes against all current practice of options usage. Option is mapped to a
C structure, once loaded it is cached, and reused while cache is still alive.
Doing other way will increase the mess.
> I'd rather do that then turn this into an enum that is masquerading as a
boolean.
I think the core of the problem, is that you still thinking about this option
as a boolean. It is no longer a boolean. It is nullable-boolean, or call it
whatever you want, but not a boolean anymore. It has 3 values available. The
most simple way to implement that is to use enum.
If you want to have not-set/null status marked as a separate flag, you can have
it. But then you should redesign all options to follow that logic: do not use
unreachable default value, but use null/unset flag. That is acceptable, if you
really need this, but should be done to all options. But I do not think it
worth efforts.
--
Nikolay Shaplov aka Nataraj
Fuzzing Engineer at Postgres Professional
Matrix IM: @dhyan:nataraj.su
From | Date | Subject | |
---|---|---|---|
Next Message | Nikolay Shaplov | 2025-03-24 18:03:11 | Re: vacuum_truncate configuration parameter and isset_offset |
Previous Message | Mahendra Singh Thalor | 2025-03-24 17:51:32 | Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote |