[PATCH] Document wal_compression=on
The docs currently don't say what wal_compression=on is, so here is a
patch.
Christoph
Attachments:
0001-Document-wal_compression-on.patchtext/x-diff; charset=us-asciiDownload+1-1
On Mon, Jun 29, 2026 at 5:04 PM Christoph Berg <myon@debian.org> wrote:
The docs currently don't say what wal_compression=on is, so here is a
patch.
+1 for documenting this.
+ The value <literal>on</literal> is a deprecated alias for
<literal>pglz</literal>.
"deprecated" implies we may remove it someday. I don't think we'd gain
from doing that, but we could instead call 'on' a "historical
spelling" of 'pglz'.
--
John Naylor
Amazon Web Services
Re: John Naylor
+ The value <literal>on</literal> is a deprecated alias for
<literal>pglz</literal>."deprecated" implies we may remove it someday. I don't think we'd gain
from doing that, but we could instead call 'on' a "historical
spelling" of 'pglz'.
Or perhaps leave the door open for picking a better default in the future?
The value <literal>on</literal> is currently an alias for <literal>pglz</literal>.
(I would be fine with either of the 3 variants.)
Maybe we should also update the postgresql.conf.sample:
#wal_compression = off # enables compression of full-page writes;
- # off, pglz, lz4, zstd, or on
+ # off, pglz (or on), lz4, or zstd
(Or just delete it there.)
Christoph
On Mon, Jun 29, 2026 at 05:41:27PM +0700, John Naylor wrote:
+ The value <literal>on</literal> is a deprecated alias for
<literal>pglz</literal>."deprecated" implies we may remove it someday. I don't think we'd gain
from doing that, but we could instead call 'on' a "historical
spelling" of 'pglz'.
+1.
--
Michael
Hi
The recent PostgreSQL commit changes the default TOAST compression to lz4 when
LZ4 support is available, based on the rationale that LZ4 is generally more
efficient than pglz in terms of CPU usage and compression ratio.Given
that, should we also consider changing the default compression method used
by wal_compression = on from pglz to lz4?
Currently, wal_compression = on still maps to pglz, while lz4 has to be
selected explicitly with:
wal_compression = lz4
If LZ4 is now considered stable and preferable enough to become the
default for TOAST compression, it may be worth aligning WAL compression
behavior as well, or at least discussing whether on should continue to
imply pglz.
Thanks
On Tue, Jun 30, 2026 at 4:27 PM wenhui qiu <qiuwenhuifx@gmail.com> wrote:
The recent PostgreSQL commit changes the default TOAST compression to lz4 when LZ4 support is available, based on the rationale that LZ4 is generally more efficient than pglz in terms of CPU usage and compression ratio.Given that, should we also consider changing the default compression method used by wal_compression = on from pglz to lz4?
FYI, default value of wal_compression is "off".
--
John Naylor
Amazon Web Services
Re: John Naylor
FYI, default value of wal_compression is "off".
Still, there is value in being consistent. If default_toast_compression=lz4
and I turn wal_compression "on", I would also accept lz4 there.
We are picking the best toast compression algorithm by default, we
should also do that for wal.
Christoph
On Tue, Jun 30, 2026 at 4:57 PM Christoph Berg <myon@debian.org> wrote:
Re: John Naylor
FYI, default value of wal_compression is "off".
Still, there is value in being consistent. If default_toast_compression=lz4
and I turn wal_compression "on", I would also accept lz4 there.We are picking the best toast compression algorithm by default, we
should also do that for wal.
The thread subject is about documenting the state of affairs that have
existed since PG15. If you want to propose a change in behavior for
master, that's material for a separate thread.
--
John Naylor
Amazon Web Services
Re: To John Naylor
Or perhaps leave the door open for picking a better default in the future?
The value <literal>on</literal> is currently an alias for <literal>pglz</literal>.
Maybe we should also update the postgresql.conf.sample:
I'm attaching v2 that implements this (without the "currently").
Christoph
Attachments:
v2-0001-Document-wal_compression-on.patchtext/x-diff; charset=us-asciiDownload+2-2
On Tue, Jun 30, 2026 at 5:19 PM Christoph Berg <myon@debian.org> wrote:
The value <literal>on</literal> is currently an alias for <literal>pglz</literal>.
Maybe we should also update the postgresql.conf.sample:
I'm attaching v2 that implements this (without the "currently").
I pushed this with the change of using the language "historical
spelling" as mentioned upthread.
--
John Naylor
Amazon Web Services