Is there a way to physically move a PostgreSQL 9.3 tablespace from /old/dir
to /new/dir
? I'd like to just mv
the directory and tell PostgreSQL that the tablespace is now located at /new/dir
. Looks like ALTER TABLESPACE
only lets you rename.
I'd like to avoid creating a new tablespace and moving the database to it. I assume that would be a slow copy process that requires a lot of time and disk space. I also want to avoid symlinking /old/dir
to /new/dir
.
Best Answer
I assume that your tablespace name is
tblspc
.or
Then, you can see the tablespace's directory has changed.