Question

How do you change the defined WAL directory? During the installation I defined a directory, /var/lib/wal and the $PGDATA/pg_xlog has a symbolic link pointing to that directory.

How do I change the postgres setting to write the WAL files elsewhere - without having to re-install?

Was it helpful?

Solution

This can be done according to the documentation [here]:(http://www.postgresql.org/docs/9.1/static/wal-internals.html)

It is advantageous if the log is located on a different disk from the main database files. This can be achieved by moving the pg_xlog directory to another location (while the server is shut down, of course) and creating a symbolic link from the original location in the main data directory to the new location.

OTHER TIPS

It is very-very simple:

  1. Make sure your postgres is not running!
  2. mount your WAL disk to an easy accessible folder
  3. check the permissions of your WAL directory ($PG_DATA/pg_xlog/)
  4. copy or move all files from $PG_DATA/pg_xlog/ into this directory
  5. unmount the WAL disk and remount it to $PG_DATA/pg_xlog/
  6. Check the permissions and fix if necessary (of the directory and files inside)
  7. Start postgres again ^^

You are done!

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top