Error in creating symlink for pg_wal in postgress

458 Views Asked by At
  1. Stopped the postgresql service
  2. Then moved pg_wal from "/var/lib/postgresql/11/main/ " to "/root/pg_xlog/archivedir"**
  3. Created symlink using the command "ln -s /root/pg_xlog/archivedir /var/lib/postgresql/11/main/pg_wal **"
  4. It created a "pg_wal->/root/pg_xlog/archivedir" under /var/lib **
  5. And then tried to restart the postgresql main service, its showing error not getting restarted .
  6. Then checked inside the log file .its shown below error like pg_wal directory not found but it is present as a pointer inside /var/lib/postgresql/11/main as shown above.

This symlink created as link for pg_wal inside /var/lib/postgresql/11/main/ for which , when tried to restart postgresql main its throwing error like

"required WAL directory "pg_wal" does not exist"

please suggest....

1

There are 1 best solutions below

0
On

This would be easier to answer if you could reformat your question with the direct output from your terminal, but my suspicion is that you have a permission issue reading things under /root/pg_xlog/archivedir as the postgres (OS) user.

As a bonus tip, pointing the active wal dir to something that looks like an archive wal dir from an older version of Postgres seems like a dangerous idea.