0

I'm wondering If I understand WAL internals correctly.

I have a Postrges database and I'm writing new data to it. New files are created in WAL directory and its size is constantly increasing.

When I stop my writing process I expect no new files will be created in WAL and after some time logs from WAL will be checkpointed to storage and old files deleted from WAL.

However this is not what happens. Old files are deleted but new files are constantly created so finally no space in WAL is reclaimed and the directory grows.

I can see no files older than 2h but at the same time every minute new files come up.

Is it correct? How can I free some space in WAL directory then?

Ardelia Lortz
  • 72
  • 1
  • 8
  • Seems to be working files are being recycled as they should be. If you want a more definitive answer then you will need to provide hard data rather then a vague description. – Adrian Klaver Sep 30 '22 at 22:31
  • https://dba.stackexchange.com/questions/229274/how-do-i-cleanup-postgres-wal – richyen Sep 30 '22 at 23:01
  • 1
    Does this answer your question? [Which Postgresql WAL files can I safely remove from the WAL archive folder](https://stackoverflow.com/questions/35144403/which-postgresql-wal-files-can-i-safely-remove-from-the-wal-archive-folder) – richyen Sep 30 '22 at 23:02

0 Answers0