X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id DBDF89FB2F1 for ; Tue, 22 Aug 2006 22:36:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 25859-09 for ; Wed, 23 Aug 2006 01:36:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 4234C9FB2B6 for ; Tue, 22 Aug 2006 22:36:19 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k7N1a9lD029598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Aug 2006 19:36:11 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k7N1a8fu060147; Tue, 22 Aug 2006 19:36:08 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k7N1a8Ci060146; Tue, 22 Aug 2006 19:36:08 -0600 (MDT) (envelope-from mfuhr) Date: Tue, 22 Aug 2006 19:36:08 -0600 From: Michael Fuhr To: "Craig A. James" Cc: pgsql-performance@postgresql.org Subject: Re: Moving a tablespace Message-ID: <20060823013608.GA60075@winnie.fuhr.org> References: <44EBAC86.7070503@modgraph-usa.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44EBAC86.7070503@modgraph-usa.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.817 tagged_above=0 required=5 tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL, UNPARSEABLE_RELAY X-Spam-Level: *** X-Archive-Number: 200608/368 X-Sequence-Number: 20553 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