pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Koczan <pjkoczan@gmail.com>
To: Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
Cc: pgsql-admin@postgresql.org
Subject: Re: Moving a tablespace
Date: Wed, 2 Apr 2008 14:44:53 -0500
Message-ID: <4544e0330804021244o1141c119t74cbd5937490cbce@mail.gmail.com> (raw)
In-Reply-To: <8EA62D1B324F0A438A36E8B5F0848EB8F32051@jdcmail1.joslin.harvard.edu>
References: <8EA62D1B324F0A438A36E8B5F0848EB8F32051@jdcmail1.joslin.harvard.edu>

On Wed, Apr 2, 2008 at 2:05 PM, Hyatt, Gordon
<Gordon.Hyatt@joslin.harvard.edu> wrote:
> I want to move an existing tablespace on an FC8 box.  I read (at
>  http://www.postgresql.org/docs/8.2/static/manage-ag-tablespaces.html)
>  that one can simply stop the server, update the symbolic link in
>  $PGDATA/pg_tblspc, start the server, then update the pg_tablespace
>  catalog to point to the new location.
>
>  Is this all there is to moving a tablespace?  It seems too easy.
>
>  The tablespace I want to move is only around 1GB in size so dropping and
>  reloading during the next maintenance cycle is not that much of an
>  issue; although, I'd prefer not to.

Couldn't you also create a new tablespace elsewhere, and use the SET
TABLESPACE subcommand of ALTER TABLE
(http://www.postgresql.org/docs/8.2/static/sql-altertable.html) to
migrate all the appropriate tables?

Granted, it's not exactly the same as moving the tablespace, but
there's less manual updating of system catalogs and potentially less
downtime. I don't have a whole lot of experience with tablespaces so I
may be missing something, but that's something you might want to try
out.

Peter



view thread (2+ messages)

Message-ID: <4544e0330804021244o1141c119t74cbd5937490cbce@mail.gmail.com>
Permalink:  ../4544e0330804021244o1141c119t74cbd5937490cbce@mail.gmail.com/
Also on:    postgresql.org/message-id/4544e0330804021244o1141c119t74cbd5937490cbce@mail.gmail.com

 · 

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-admin@postgresql.org
  Cc: pjkoczan@gmail.com, Gordon.Hyatt@joslin.harvard.edu
  Subject: Re: Moving a tablespace
  In-Reply-To: <4544e0330804021244o1141c119t74cbd5937490cbce@mail.gmail.com>

* 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