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

Re: Symbolic Links to Tablespaces

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Campbell, Lance" <lance(at)illinois(dot)edu>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>,<pgsql-performance(at)postgresql(dot)org>
Subject: Re: Symbolic Links to Tablespaces
Date: 2008-05-26 18:26:11
Message-ID: 483B00C3.5030005@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-performance
Campbell, Lance wrote:
> Once I have assigned tables and indexes to a particular tablespace that
> points to a particular location on disk is there a simple way to move
> the files to a new location?
> 
> Example:
> Table xyz is using tablespace xyz_tbl which is located at
> /somedir/xyz_tbl on the disk.  If I want to move it to a new disk
> located at /someotherdir/xyz_tbl/ how can I do that easily?  

Shut down the database server, replace the symbolic link in 
data/pg_tblspc to the new location, and start the server again. The 
location is also stored in pg_tablespace catalog; you'll need to fix it 
with "UPDATE pg_tablespace SET spclocation ='/someotherdir/xyz_tbl' 
WHERE spcname='xyz_tbl'", or pg_dumpall will still show the old location.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

In response to

Responses

pgsql-performance by date

Next:From: Tino WildenhainDate: 2008-05-26 19:19:03
Subject: Re: Symbolic Links to Tablespaces
Previous:From: A. KretschmerDate: 2008-05-26 17:32:12
Subject: Re: Symbolic Links to Tablespaces

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