Force WAL cleanup on running instance

Поиск
Список
Период
Сортировка
От Torsten Krah
Тема Force WAL cleanup on running instance
Дата
Msg-id 3f91429eb65ac8aa3c77361c587e786a290b92f0.camel@gmail.com
обсуждение исходный текст
Ответы Re: Force WAL cleanup on running instance
Re: Force WAL cleanup on running instance
Список pgsql-general
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
 
-- 





В списке pgsql-general по дате отправления:

Предыдущее
От: PegoraroF10
Дата:
Сообщение: Re: How to discover what table is
Следующее
От: Nicola Contu
Дата:
Сообщение: Re: Streaming replication - 11.5