Search code examples
postgresqldatabase-administrationpostgresql-9.4

How can I change my postgresql WAL file size?


How can I change my PostgreSQL WAL file size as my wish. By default at pg_wal directory postgres generate 16MB WAL files. I try to change using max_wal_size, min_wal_size parameter. But I think it is not right parameter to change. Necessary details given in the below screenshot.

enter image description here


Solution

  • With an old and outdated version like 9.4, your only option is to build PostgreSQL from source and configure it with

    ./configure --with-wal-segsize=1024
    

    Then you have to dump and restore the cluster to that new installation.

    With current versions. You could simply shut down PostgreSQL cleanly (important!) and run pg_resetwal with the appropriate option.

    Upgrade!