Here's a v5, with mostly minor changes compared to v4.
The main change is that it prefers zstd over lz4, per the discussion
about benchmark results. This is what v3 did.
I did not like the DEFAULT_WAL_COMPRESSION name, because that seems to
imply default for the wal_compression GUC. Which is misleading. I've
renamed it to WAL_COMPRESSION_ON.
Updated/reworded the commit message a bit. Feel free to suggest
adjustments. I've included only two people as reviewers - there's been a
lot of discussion about what "on" should mean, but I don't think that
counts as reviews.
regards
--
Tomas Vondra