[PATCH] Document wal_compression=on

Started by Christoph Berg27 days ago10 messageshackers
Jump to latest
#1Christoph Berg
myon@debian.org

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
#2John Naylor
john.naylor@enterprisedb.com
In reply to: Christoph Berg (#1)
Re: [PATCH] Document wal_compression=on

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

#3Christoph Berg
myon@debian.org
In reply to: John Naylor (#2)
Re: [PATCH] Document wal_compression=on

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

#4Michael Paquier
michael@paquier.xyz
In reply to: John Naylor (#2)
Re: [PATCH] Document wal_compression=on

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
#5wenhui qiu
qiuwenhuifx@gmail.com
In reply to: Michael Paquier (#4)
Re: [PATCH] Document wal_compression=on

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

#6John Naylor
john.naylor@enterprisedb.com
In reply to: wenhui qiu (#5)
Re: [PATCH] Document wal_compression=on

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

#7Christoph Berg
myon@debian.org
In reply to: John Naylor (#6)
Re: [PATCH] Document wal_compression=on

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

#8John Naylor
john.naylor@enterprisedb.com
In reply to: Christoph Berg (#7)
Re: [PATCH] Document wal_compression=on

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

#9Christoph Berg
myon@debian.org
In reply to: Christoph Berg (#3)
Re: [PATCH] Document wal_compression=on

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
#10John Naylor
john.naylor@enterprisedb.com
In reply to: Christoph Berg (#9)
Re: [PATCH] Document wal_compression=on

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