How can we configure the PostgreSQL14 wal retention policy?

Hi Folks,

How can we set the automatic retention policy for the pg_xlog and archive logs in Postgresql 14? I am little confusing about the archeve logs and pg xlogs retention or how can we over come the disk spaces issues?
NOTE: Master node has two replica servers.

1 Like

Can someone please help on this?

1 Like

Hi Naresh,
I just replied over your other question related to backups, in which I mentioned pgBackRest. If you are going to use it, you can make the most out of it by setting it up for the WAL archival too:

You may also want to read up on how to quickly (and manually) clean up WALs if you are in dire need of disk space, by using pg_archivecleanup:

If you are currently having issues with the archival process, you should check the PostgreSQL error log for clues on why it may be failing, and also check the configuration variables are correctly set.

Let me know if this helped.

1 Like

Hi @Agustin_G

Thank so much for the suggestion.

1 Like