From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Remove toast_max_chunk_size from control file
Date: Sun, 06 Sep 2026 21:25:34 -0400
Message-ID: <149283.1788744334@sss.pgh.pa.us> (raw)
In-Reply-To: <ap4Q7r5J6sY_eb4z@paquier.xyz>
References: <ap4Q7r5J6sY_eb4z@paquier.xyz>
Michael Paquier <michael@paquier.xyz> writes:
> My main argument regarding the removal of toast_max_chunk_size in the
> control file is that it is a redundant check, due to the fact that the
> definition of TOAST_OID_MAX_CHUNK_SIZE is tied to two fields that we
> already track in the control file:
> - BLCKSZ
> - MAXALIGN
I don't think this follows. heaptoast.h says:
#define EXTERN_TUPLES_PER_PAGE 4 /* tweak only this */
#define EXTERN_TUPLE_MAX_SIZE MaximumBytesPerTuple(EXTERN_TUPLES_PER_PAGE)
#define TOAST_MAX_CHUNK_SIZE \
(EXTERN_TUPLE_MAX_SIZE - \
MAXALIGN(SizeofHeapTupleHeader) - \
sizeof(Oid) - \
sizeof(int32) - \
VARHDRSZ)
EXTERN_TUPLES_PER_PAGE is a free variable here, and it's entirely
possible that someone would wish to tweak it. So I disagree that
it's safe to remove this value from pg_control.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz
Subject: Re: Remove toast_max_chunk_size from control file
In-Reply-To: <149283.1788744334@sss.pgh.pa.us>
References: <ap4Q7r5J6sY_eb4z@paquier.xyz> <149283.1788744334@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox