Skip site navigation (1) Skip section navigation (2)

Re: Moving a tablespace

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Craig A(dot) James" <cjames(at)modgraph-usa(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Moving a tablespace
Date: 2006-08-23 01:36:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
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:

"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

In response to


pgsql-performance by date

Next:From: ChrisDate: 2006-08-23 01:37:13
Subject: Re: Query tuning
Previous:From: Craig A. JamesDate: 2006-08-23 01:16:54
Subject: Moving a tablespace

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group