Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 059512E0061 for ; Mon, 26 May 2008 15:26:37 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 44185-03 for ; Mon, 26 May 2008 15:26:17 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail01.enterprisedb.com (webmail.enterprisedb.com [63.246.7.168]) by developer.postgresql.org (Postfix) with ESMTP id BEBEB2E004D for ; Mon, 26 May 2008 15:26:18 -0300 (ADT) thread-index: Aci/Xhey6tak8Hm2QeC6O2zPOoxsNQ== Received: from [87.127.95.195] ([87.127.95.195]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 May 2008 14:27:01 -0400 Message-ID: <483B00C3.5030005@enterprisedb.com> Date: Mon, 26 May 2008 19:26:11 +0100 Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 From: "Heikki Linnakangas" Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080420) MIME-Version: 1.0 To: "Campbell, Lance" Cc: "Tom Lane" , Subject: Re: Symbolic Links to Tablespaces References: <21505.1211814531@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; format=flowed; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 May 2008 18:27:01.0671 (UTC) FILETIME=[172CEB70:01C8BF5E] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/338 X-Sequence-Number: 30306 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