how to move a postgres tablespace on windows?
0
votes
1
answer
191
views
Now do I move a tablespace on a windows installation of postgres?
This thread shows how to do it on unix, not windows.
The tablespace was originally created with this command...
CREATE TABLESPACE tabspace2 OWNER theowner LOCATION 'e:/pgdata2/fdb';
The command
ALTER TABLESPACE
allows the name to be edited, but I need to change the file location.
Work from the previous thread, I can get the oid
from
SELECT oid,spcname FROM pg_tablespace WHERE spcname = 'tabspace2';
Digging through my postgres installation I've found this folder where the bottom level foldername matches the oid c:\pg_data\14\data\pg_tblspc\57620
. The icon for this folder has a little blue arrow in the bottom left corner - indicating (I think) that the folder is a link. I believe that this links to the location on e:
that was specified when the table space was created.
The trail starts to run cold here, I think windows links can only be dropped or created (not edited), so how can I move the tablespace? It's currently populated with live data, so I'm trying to establish the correct methodology *before* I start fiddling. Any help appreciated.
Asked by ConanTheGerbil
(1303 rep)
Jun 19, 2024, 08:47 AM
Last activity: Jun 26, 2025, 09:06 PM
Last activity: Jun 26, 2025, 09:06 PM