Re: PostgreSQL Archive Log Partition Reaching 95% – Need Automated Cleanup - Mailing list pgsql-general

From Laurenz Albe
Subject Re: PostgreSQL Archive Log Partition Reaching 95% – Need Automated Cleanup
Date
Msg-id 613e378c68d816e700a694f97d3a49b8afed7678.camel@cybertec.at
Whole thread Raw
In response to PostgreSQL Archive Log Partition Reaching 95% – Need Automated Cleanup  (loganathan P <plogandba@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: loganathan P
Date:
Subject: PostgreSQL Archive Log Partition Reaching 95% – Need Automated Cleanup
Next
From: Adrian Klaver
Date:
Subject: Re: Timezone handling with timestamp without time zone columns