Request for cleaner explanation of default_toast_compression parameter

From: Boris Mironov <boris_mironov(at)outlook(dot)com>
To: "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Request for cleaner explanation of default_toast_compression parameter
Date: 2026-03-29 05:37:47
Message-ID: PH0PR08MB7020D7A95CD8F730946B2DA08855A@PH0PR08MB7020.namprd08.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hello,

I would like to request a cleaner explanation of default_toast_compression parameter. It could be just me, but following sentence could be misread:

"This variable sets the default TOAST<https://www.postgresql.org/docs/18/storage-toast.html> compression method for values of compressible columns."
(https://www.postgresql.org/docs/18/runtime-config-client.html#GUC-DEFAULT-TOAST-COMPRESSION)

The way I read it (and perhaps I'm not the only one): "If column value is too big to be stored in-row it goes to TOAST and gets compressed with algorithm set by default_toast_compression parameter"

This leads to the suggestion that initially this column gets compressed by pglz as default algo and if tuple is bigger than 2000 bytes, the column gets compressed with algo defined by default_toast_compression and saved into the TOAST table. This raises suggestion about compressing same string data twice when default_toast_compression=lz4:

1.
in an attempt to save string in-tuple with pglz;
2.
with lz4 to save it in the TOAST table.

Perhaps something like following will avoid misreading:

"This variable sets the default compression method for values of compressible columns to be stored in-tuple or TOAST table."

Best regards,
Boris

Browse pgsql-docs by date

  From Date Subject
Next Message Clodoaldo Pinto 2026-03-29 13:39:08 Themed offline HTML docs
Previous Message David G. Johnston 2026-03-26 02:33:42 Re: [PATCH] Doc: clarify that pg_upgrade statistics transfer works cross-version