On Tue, 2026-03-03 at 19:51 +0530, loganathan P wrote: > We have PostgreSQL 15 and PostgreSQL 17 databases running in separate > environments on different servers. > Each database is approximately 1.5 TB in size and highly active, generating > around 500 GB of archive > logs per day. We have VM SRM replication configured. > > The archive log partition reaches 95–100% utilization before backups are > taken. After the backups are > completed, we must manually remove the archived log files to free up space. > > Could you please advise whether PostgreSQL has any built-in parameters or > mechanisms to automatically > delete archived log files once they have been successfully backed up?
Since PostgreSQL doesn't know about your archives, there is no way for it to clean up automatically. You have to do that yourself. There is the "pg_archivecleanup" utility that you can use with the backup file generated in the WAL archive: pg_archivecleanup /mnt/server/archivedir 000000010000000000000010.00000020.backup The easiest way would be to use a backup software like pgBackRest that does these things for you. Yours, Laurenz Albe
