1

I run postgres server (10.6) on my pc just for some custom programs. Problem is every time I restore a backup file of 600mb - the pg_wal directory increases in size for 600mb. Is there a way to easily restore + get rid of the wal files?

I have read about pg_archivecleanup utility but I don't think it helps in my case.

EDIT: Alternatively, is it possible at all to restore without recreating wal files as I don't need them. What will be the config entries for this.

4
  • What are your max_wal_size and min_wal_size? Do you have any replication set up? How are you doing the restore?
    – jjanes
    Oct 12, 2019 at 14:22
  • 1GB and and 80MB. wal_level was set by default to replica if that's what you meant. I tried setting it to minimal, but service wouldn't start. It changed to logical, but wal.s were updated/recreated on a test restore to a new database. Oct 12, 2019 at 15:21
  • "service wouldn't start." With an error message?
    – jjanes
    Oct 12, 2019 at 15:27
  • yeah. figured out there was the max_wal_senders had to be set to 0. however, archive = off, minimal and no senders still got me nowhere on a fresh install and test restore Oct 12, 2019 at 15:46

2 Answers 2

1

The files should go away on their own after a checkpoint or two (if there is little activity, it might take longer for the files to go away. If they were renamed already in anticipation of being recycled back when the server was very active, they won't go away until they get re-used). If you don't want it to use up to 1GB of WAL, then you should lower "max_wal_size". Otherwise, it might do what you gave it permission to do.

0

your wal_level is set to what ?

you can set archive_mode to "off" temporary so you can restore without WAL logs consumption https://www.postgresql.org/docs/11/runtime-config-wal.html

1
  • thanks. I did. however wal files were recreated on a test restore. Oct 12, 2019 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.