Re: vacuum_truncate configuration parameter and isset_offset

Nikolay Shaplov <dhyan@nataraj.su>

From: Nikolay Shaplov <dhyan@nataraj.su>
To: Nathan Bossart <nathandbossart@gmail.com>, Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Robert Treat <rob@xzilla.net>, Fujii Masao <masao.fujii@oss.nttdata.com>, Albe <laurenz.albe@cybertec.at>, Gurjeet Singh <gurjeet@singh.im>, Will Storey <will@summercat.com>, Álvaro Herrera <alvherre@alvh.no-ip.org>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2025-03-24T15:12:06Z
Lists: pgsql-hackers
В письме от понедельник, 24 марта 2025 г. 17:48:25 MSK пользователь Robert 
Haas написал:
> On Mon, Mar 24, 2025 at 10:43 AM Nathan Bossart
> 
> <nathandbossart@gmail.com> wrote:
> > Overall, the biggest reason I didn't proceed with the enum is because it
> > felt like it was making it the user's problem.  Rather than just teaching
> > our code how to determine if a reloption was explicitly set, we'd be
> > introducing unnecessary complexity to the user, or at least we'd be trying
> > to closely match the existing functionality in an attempt to hide this
> > complexity from them.
> 
> +1. Giving the user the ability to set the option to a value called
> "unset" doesn't seem right to me.

1. Enum allows you to make default value "unreachable" for setting. But this 
is not the most important thing. 

2.  This option has three possible values: on/off/system_default. We can find 
better name for system_default, but it would not change it's meaning. 
I would prefer to let user set these three values explicitly.

Nobody would guess that 

ALTER TABLE test SET (vacuum_truncate=false);
means "off"

and
ALTER TABLE test RESET (vacuum_truncate);
means "system_default"

This will lead to a lot of confusion. 

So I strongly against this  implying third value for boolean. This is nasty 
thing. Boolean should have two values.


-- 
Nikolay Shaplov aka Nataraj
Fuzzing Engineer at Postgres Professional
Matrix IM: @dhyan:nataraj.su