pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Fuhr <mike@fuhr.org>
Cc: Craig A. James <cjames@modgraph-usa.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Moving a tablespace
Date: Tue, 22 Aug 2006 22:34:59 -0400
Message-ID: <14078.1156300499@sss.pgh.pa.us> (raw)
In-Reply-To: <20060823013608.GA60075@winnie.fuhr.org>
References: <44EBAC86.7070503@modgraph-usa.com>
	<20060823013608.GA60075@winnie.fuhr.org>

Michael Fuhr <mike@fuhr.org> writes:
> 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?

> The last paragraph of the Tablespaces documentation might be helpful:
> http://www.postgresql.org/docs/8.1/interactive/manage-ag-tablespaces.html

> I just tested this and it appeared to work, but this hypothetical
> DBA might want to wait for others to comment before proceeding.

AFAIK it works fine.  Shut down postmaster, move tablespace's directory
tree somewhere else, fix the symbolic link in $PGDATA/pg_tblspc, start
postmaster, update the pg_tablespace entry.  There isn't anyplace else
in Postgres that knows where that link leads.  But if you are running
a hot PITR backup, see the caveats in TFM about what will happen on the
backup machine.

> He might also want to initdb and populate a test cluster and practice
> the procedure before doing it for real.

"Always mount a scratch monkey" ...

			regards, tom lane



view thread (3+ messages)

Message-ID: <14078.1156300499@sss.pgh.pa.us>
Permalink:  ../14078.1156300499@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14078.1156300499@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, mike@fuhr.org, cjames@modgraph-usa.com
  Subject: Re: Moving a tablespace
  In-Reply-To: <14078.1156300499@sss.pgh.pa.us>

* 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