PostgreSQL 19 will change the default TOAST compression algorithm from pglz to lz4. TOAST handles out-of-line storage for oversized column values, and lz4 offers significantly faster compression and decompression with only a modest reduction in compression ratio (~7% less tight than pglz). The default stayed pglz through versions 14–18 because lz4 required an optional build dependency, but PostgreSQL 19 flips lz4 to an opt-out dependency and makes it the default when available. For users on versions 14–18, switching to lz4 is safe and recommended: existing data retains its original compression algorithm, new writes use the new setting, and no migration or rewrite is required. Switching existing data requires an explicit table rewrite.

4m read timeFrom postgr.es
Post cover image
Table of contents
A word on what’s being compressedThe default is changingWhat to do
198 Impressions