On Wed, Jan 28, 2026 at 2:16 PM Wasim Devale <wasimd60@gmail.com> wrote:
Hi All
I am taking directory dump from postgresql 12 and restoring it on postgresql 17 this process create 1.2TB of wals files in pg_wal directory. Can we reduce this WAL files generation via any configuration changes?
Sure. This is what I used when restoring some 3+ TB databases. (Your values for $SharedBuffs and $MaintMem will vary based on how much RAM you have and how many threads you use in pg_restore.)
Setting $SharedBuffs and (especially) $MaintMem too high will cause the Linux oom-killer to kill one or more of the CREATE INDEX or ADD PRIMARY KEY statements, and you'll scratch your head looking at the pg_restore log file wondering what happened.
These are "bad" settings if you have other databases in your instance and they need to keep running while you restore your DB. I don't have that problem, so think it's great.