| From: | Nathan Bossart <nathandbossart(at)gmail(dot)com> | 
|---|---|
| To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> | 
| Cc: | Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Robert Treat <rob(at)xzilla(dot)net>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Gurjeet Singh <gurjeet(at)singh(dot)im>, Andres Freund <andres(at)anarazel(dot)de>, Will Storey <will(at)summercat(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: Disabling vacuum truncate for autovacuum | 
| Date: | 2025-03-20 18:13:02 | 
| Message-ID: | Z9xaroJSrS44HyKG@nathan | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general pgsql-hackers | 
On Thu, Mar 20, 2025 at 09:59:45AM -0700, David G. Johnston wrote:
> I get the need for this kind of logic, since we used a boolean for the
> table option, but as a self-proclaimed hack it seems worth more comments
> than provided here.  Especially pertaining to whether this is indeed
> generic or vacuum_truncate specific.  It's unclear since both isset and
> vacuum_truncate_set have been introduced.
I'm happy to expand the comments, but...
> If it is now a general property
> applying to any setting then vacuum_truncate_set shouldn't be needed - we
> should just get the isset value of the existing vacuum_truncate reloption
> by name.
the reason I added this field is because I couldn't find any existing way
to get this information where it's needed.  So, I followed the existing
pattern of adding an offset to something we can access.  This can be used
for any reloption, but currently vacuum_truncate is the only one that does.
How does something like this look for the comment?
	/*
	 * isset_offset is an optional offset of a field in the result struct
	 * that stores whether the value is explicitly set for the relation or
	 * has just picked up the default value.  In most cases, this can be
	 * deduced by giving the reloption a special default value (e.g., -2 is
	 * a common one for integer reloptions), but this isn't always
	 * possible.  One notable example is Boolean reloptions, where it's
	 * difficult to discern the source of the value.  This offset is only
	 * used if given a value greater than zero.
	 */
	int			isset_offset;
-- 
nathan
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2025-03-20 18:54:04 | Re: After upgrading libpq, the same function(PQftype) call returns a different OID | 
| Previous Message | Álvaro Herrera | 2025-03-20 17:48:27 | Re: After upgrading libpq, the same function(PQftype) call returns a different OID | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Noah Misch | 2025-03-20 18:19:04 | Re: AIO v2.5 | 
| Previous Message | Antonin Houska | 2025-03-20 18:09:53 | Re: why there is not VACUUM FULL CONCURRENTLY? |