How to modify a Postgres tablespace location I am using a workstation that has 3 different hard drives. Some time ago I got a large database to reverse engineer that would not fit in the system drive. Therefore I created a new table-space in one of the the other hard drives, that at the time was mounted on the /media/Work1 folder.

Everything was working fine, until today at startup the system decided to mount the drive on the /media/Work folder. Naturally, Postgres can no longer access the databases in that table-space. 

How can I change the location of a table-space in Postgres? I am aware of the pg_tablespace_location function, but not of somthing to modify it.
The tablespace location is defined by a symbolic link in the pg_tblspc directory (this is why, by the way, you can only use custom tablespaces on systems that have symlinks, as stated in the documentation):

~/9.5/main/pg_tblspc$ ls -l
total 0
lrwxrwxrwx 1 postgres postgres 13 Mar  5 10:33 132568 -&gt; /tablespace2/


As user postgres, you can change the location this symlink points to:

postgres@local:~/9.5/main/pg_tblspc$ ln -snf /tablespace/ 132568


This will fix your tablespace location.  As a precaution, I'd do this only when the database is not running.

However, you have to be sure why the location changed in the first place and that it won't change back or to anything else.