Skip to main content

Timeline for WAL files management

Current License: CC BY-SA 4.0

8 events
when toggle format what by license comment
Jul 11, 2022 at 12:00 answer added Laurenz Albe timeline score: 2
Jul 11, 2022 at 11:54 comment added user1822 Archiving is done by Postgres whenever a WAL segment is no longer needed. It's typically part of a complete backup strategy. It does not qualify as "messing with pg_wal manually"
Jul 11, 2022 at 11:54 comment added eijeze Check your max_wal_size setting, and reduce to be 80MB. That should do it. If not, then you might have problem with broken archiving, or old replication slots, or wal_keep_size, or prepared transactions. Hard to say. For debugging I'd suggest you ask on irc/slack/discord, as it will more of a conversation than "here you go: do a, b, c".
Jul 11, 2022 at 11:52 comment added padjee I find some articles about archiving the wal files, like dba.stackexchange.com/questions/115147/how-i-compact-wal-files and endpointdev.com/blog/2017/03/…. How come ?
Jul 11, 2022 at 11:26 comment added user1822 Postgres will remove no longer needed WAL segments automatically until min_wal_size is reached. It might take a while though, but eventually they will be gone. Never, ever mess with the pg_wal directory manually. Never
Jul 11, 2022 at 11:23 comment added padjee Ok. Nice. How can I safely reduce my existing WAL files then ?
Jul 11, 2022 at 11:11 comment added user1822 The only way to reduce the WAL size is to run fewer DML statements.
Jul 11, 2022 at 10:49 history asked padjee CC BY-SA 4.0