pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedMoving a tablespace
2+ messages / 2 participants
[nested] [flat]
* Moving a tablespace
@ 2008-04-02 19:05 Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
2008-04-02 19:44 ` Re: Moving a tablespace Peter Koczan <pjkoczan@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Hyatt, Gordon @ 2008-04-02 19:05 UTC (permalink / raw)
To: pgsql-admin
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.
Thanks in advance,
Gord
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Moving a tablespace
2008-04-02 19:05 Moving a tablespace Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
@ 2008-04-02 19:44 ` Peter Koczan <pjkoczan@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Koczan @ 2008-04-02 19:44 UTC (permalink / raw)
To: Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>; +Cc: pgsql-admin
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2008-04-02 19:44 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-04-02 19:05 Moving a tablespace Hyatt, Gordon <Gordon.Hyatt@joslin.harvard.edu>
2008-04-02 19:44 ` Peter Koczan <pjkoczan@gmail.com>
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