I have a requirement in the Postgres 14 database, which is installed in a Windows server environment. I want to move the pg_wal directory files from my G drive, where I installed my Postgres 14 database, to my D drive. This is to reduce the read-write IO of the G drive and improve its performance.
I used the symbolic link (mklink) command as given below:
mklink /D "D:\pg_wal" "G:\Postgres-14\data\pg_wal"
Here G:\Postgres-14\data\pg_wal is where my pg_wal files are, and I want them to move to D:\pg_wal. This is working, and a shortcut folder is getting created, but still, pg_wal files are there in G:\Postgres-14\data\pg_wal location and I want all the pg_wal files to automatically move to D:\pg_wal directory without getting filled in the original location (G:\Postgres-14d\data\pg_wal).
In another words, G:\Postgres-14\data\pg_wal directory should be empty, and all the pg_wal files should be collected in D:\pg_wal whenever the log files are generated. Or move the entire pg_wal directory from G drive to D Drive.
In this way, I can save space on the G drive and reduce the disk IO. Anyone, please help me get a solution or guide me if I'm doing anything wrong.