From: Torsten Krah <krah.tm@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Force WAL cleanup on running instance
Date: Wed, 11 Mar 2020 09:59:41 +0100
Message-ID: <3f91429eb65ac8aa3c77361c587e786a290b92f0.camel@gmail.com> (raw)
Hi,
I am building a docker image with a postgresql 12.2 instance and while
doing so and importing a dump and running some update scripts wal size
is increasing.
When finished I don't need all those wal files anymore and tried to
force the daemon to clean them up and tried this:
select pg_switch_wal();
CHECKPOINT;
and did wait for a minute.
Sometimes it works and wal files are cleaned and moved away so my image
size is way smaller - but it does not happen always in that minute.
So is there a way to tell postgres to force the housekeeping of the wal
stuff via a statement / command line tool?
In a "normal" running instance it just takes care of itself and it will
happen sooner or later and it doesn't really matter when that will
happen - but with my docker image which is automatically build it would
be nice to have a deterministic way of trigger that to reduce the final
size image.
Is there some way to trigger this?
kind regards
Torsten
--
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: krah.tm@gmail.com
Subject: Re: Force WAL cleanup on running instance
In-Reply-To: <3f91429eb65ac8aa3c77361c587e786a290b92f0.camel@gmail.com>
References: <3f91429eb65ac8aa3c77361c587e786a290b92f0.camel@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox