how to cleanup archive based on datetime

From: magodo <wztdyl(at)sina(dot)com>
To: Postgres general <pgsql-general(at)postgresql(dot)org>
Subject: how to cleanup archive based on datetime
Date: 2018-10-10 07:00:07
Message-ID: ca8e01bfc65c41ea223c3b57a8179c95f1a79ec4.camel@sina.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hello,

I know there is a tool `pg_archivecleanup`, but it only accepts wal
filename. What if I want to clean up all archived wal before a
specified datetime?

Though I could check the ctime fo each wal and figure out which to
remove, but it looks like not a elegent way to do this.

Also I tried to parse each wal and compare with the specified datetime
in a binary-search way, but it is based on the fact that every COMMIT
time in wal is sequential, but it looks like not the case..

Hence I wonder what is the best practice for this task?

Thank you in advance!
---
Magodo

Responses

Browse pgsql-general by date

  From Date Subject
Next Message mo jia 2018-10-10 07:46:42 Question about advance confirmed_flush_lsn using logic replication slot when there is no modification.
Previous Message magodo 2018-10-10 06:42:48 Re: pg9.6: PITR paused just after failover, need manual resume