Comments on: PostgreSQL WAL Retention and Clean Up: pg_archivecleanup https://www.percona.com/blog/postgresql-wal-retention-and-clean-up-pg_archivecleanup/ Thu, 05 Oct 2023 12:59:48 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Jobin Augustine https://www.percona.com/blog/postgresql-wal-retention-and-clean-up-pg_archivecleanup/#comment-10972531 Mon, 27 Jul 2020 12:09:21 +0000 https://www.percona.com/blog/?p=58578#comment-10972531 Thank you Igor for pointing it out. Its corrected.

]]>
By: Igor Giunta https://www.percona.com/blog/postgresql-wal-retention-and-clean-up-pg_archivecleanup/#comment-10972508 Wed, 22 Jul 2020 08:40:45 +0000 https://www.percona.com/blog/?p=58578#comment-10972508 option “-d” is for “debug”, not “delete”.
CAUTION: without “-d” and without “-n” it will silently delete the WAL (without output).

]]>
By: Jobin Augustine https://www.percona.com/blog/postgresql-wal-retention-and-clean-up-pg_archivecleanup/#comment-10971356 Thu, 31 Oct 2019 05:27:43 +0000 https://www.percona.com/blog/?p=58578#comment-10971356 Thanks for the comment and great to know that you find the blog post useful.
The steps you followed are correct.

]]>
By: Alex https://www.percona.com/blog/postgresql-wal-retention-and-clean-up-pg_archivecleanup/#comment-10971251 Thu, 03 Oct 2019 00:45:08 +0000 https://www.percona.com/blog/?p=58578#comment-10971251 Thanks Jobin!

Just a quick note, we used the following steps to get the last redo as the starting point for removing all logs prior, e.g.:

Get Redo
pg_controldata /your_path/to/pgsql/data/ | grep -i redo
Latest checkpoint’s REDO location: 9A52/AF77020
Latest checkpoint’s REDO WAL file: 0000000100009A520000000A

Then, do a dry run
pg_archivecleanup -n /your_path/to/pgsql/pg_xlog 0000000100009A520000000A

Then delete old WALs
pg_archivecleanup -d /your_path/to/pgsql/pg_xlog 0000000100009A520000000A

]]>