Re: Force WAL cleanup on running instance

Torsten Krah <krah.tm@gmail.com>

From: Torsten Krah <krah.tm@gmail.com>
To: "pgsql-general@lists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2020-03-11T17:39:52Z
Lists: pgsql-general
Am Mittwoch, den 11.03.2020, 11:46 -0500 schrieb Jerry Sievers:
> If your site can afford a restart after the bulk load,
> 
> 1. Clean shutdown.
> 2. pg_resetwal
> 3. Start 
> 
> That should leave you with a very small N WAL files, perhaps just 1,
> though I've not run it lately to reverify.

Thanks - that worked like a charm and is exactly what I was looking
for, of cause I can afford that, it's shutdown after the init anyway -
so after running pg_resetwal this was left:

root@53e0d45ce5d7:/var/lib/postgresql/data/pg_wal# ls -lh
total 17M
-rw------- 1 postgres postgres  16M Mär 11 17:23 000000010000000000000012
drwx------ 2 postgres postgres 4,0K Mär 11 17:13 archive_status

Nice one :) thanks.

kind regards

Torsten