Re: correcting tablespaces inside data folder - Mailing list pgsql-general

From Duarte Carreira
Subject Re: correcting tablespaces inside data folder
Date
Msg-id CAHE-9zAnFMX2p4FMaiSr5HO4TNEb2hBiNq_C6am5FZX3no13sQ@mail.gmail.com
Whole thread Raw
In response to Re: correcting tablespaces inside data folder  (Magnus Hagander <magnus@hagander.net>)
Responses Re: correcting tablespaces inside data folder
List pgsql-general
Magnus,
You mean changing the symlinks inside pg_tblspc?


On Fri, Jul 6, 2018 at 5:49 PM Magnus Hagander <magnus@hagander.net> wrote:
On Fri, Jul 6, 2018 at 6:42 PM, Duarte Carreira <dncarreira@gmail.com> wrote:
Hello.

Yes I'm one of those guys who only recently realized the mess of having tablespaces inside the data directory... now I want to use pg_upgrade and it will make things even worse...

Does anyone have a best approach to this problem? Fastest/safest?

pg 9.3.x on win


If you can afford to shut the server down, the easiest is to shut it down, move the tablespaces (with mv, and as long as you stay within the partition it should be almost instant), update the symlinks to point to the new location, and start it up again. 

--

pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: correcting tablespaces inside data folder
Next
From: Magnus Hagander
Date:
Subject: Re: correcting tablespaces inside data folder