PostgreSQL for windows create tablespace on network location (nfs shared) failed because directory not exist My server is Windows Server 2016. The server mounted a NFS remote storage with below command:
mount \\192.168.6.68\nfsshare z:
mkdir z:\pg_data

All the relevant permissions such as read/write/execute were set correctly on z:
I installed PostgreSQL 12.3 to C:\PostgreSQL. And then created tablespace with below commands:
create tablespace my_db_space location 'z:\pg_data'

PostgreSQL replied me:
Error, directory 'z:\pg_data' does not exist.

I also tried 'z:\pg_data', 'z:/pg_data', but all got the same error message.
I also tried another way, which is, I installed PostgreSQL in Z:\postgresql. The installation was successful. but postgreSQL service failed to start because of the error &quot;directory not found&quot;.
In Linux, the same situation didn't happen the same error.
It seems that on Windows, PostgreSQL can only use local storage as its data location, right?
Any siggestion ?
It seems that on Windows, PostgreSQL can only use local storage as its data location, right?

On any operating system, PostgreSQL should only use &quot;local&quot; file systems.
On Linux, those file systems can be mounted from other machines in a way that PostgreSQL is not aware of so things &quot;just work&quot;.
On Windows, a network drive is another thing entirely.
Under which account are you running PostgreSQL?  (Probably as a Windows Service under &quot;Local System&quot;).
Does that account have the ability to &quot;see&quot; anything not on the local machine (&quot;No&quot;).
Even if you were to change this, putting your data &quot;further&quot; from the process that needs to manipulate it is just asking for [major] Trouble.