Re: Force WAL cleanup on running instance

From: Torsten Krah <krah(dot)tm(at)gmail(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Force WAL cleanup on running instance
Date: 2020-03-11 17:39:52
Message-ID: f046621eeaae39ad2adc26280ea304ceaca3fcbe.camel@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(at)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-03-11 17:50:56 Re: How to discover what table is
Previous Message Paul Förster 2020-03-11 17:29:23 Re: Force WAL cleanup on running instance