From: Michael Fuhr <mike@fuhr.org>
To: Craig A. James <cjames@modgraph-usa.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Moving a tablespace
Date: Tue, 22 Aug 2006 19:36:08 -0600
Message-ID: <20060823013608.GA60075@winnie.fuhr.org> (raw)
In-Reply-To: <44EBAC86.7070503@modgraph-usa.com>
References: <44EBAC86.7070503@modgraph-usa.com>
On Tue, Aug 22, 2006 at 06:16:54PM -0700, Craig A. James wrote:
> Is there a way to move a tablespace to a new location without a
> dump/restore? I, er, this hypothetical guy, knows he can move it and put a
> symbolic link in for /disk2, but this is somewhat unsatisfactory since
> "/disk2" would have to exist forever.
The last paragraph of the Tablespaces documentation might be helpful:
http://www.postgresql.org/docs/8.1/interactive/manage-ag-tablespaces.html
"The directory $PGDATA/pg_tblspc contains symbolic links that point
to each of the non-built-in tablespaces defined in the cluster.
Although not recommended, it is possible to adjust the tablespace
layout by hand by redefining these links. Two warnings: do not do
so while the postmaster is running; and after you restart the
postmaster, update the pg_tablespace catalog to show the new
locations. (If you do not, pg_dump will continue to show the old
tablespace locations.)"
I just tested this and it appeared to work, but this hypothetical
DBA might want to wait for others to comment before proceeding. He
might also want to initdb and populate a test cluster and practice
the procedure before doing it for real.
--
Michael Fuhr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mike@fuhr.org, cjames@modgraph-usa.com
Subject: Re: Moving a tablespace
In-Reply-To: <20060823013608.GA60075@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox