Re: Symbolic Links to Tablespaces

From: "Campbell, Lance" <lance(at)illinois(dot)edu>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Symbolic Links to Tablespaces
Date: 2008-05-26 17:10:07
Message-ID: B10E6810AC2A2F4EA7550D072CDE8760CDDD81@SAB-FENWICK.sab.uiuc.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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?

Do I have to backup all of the tables using the tablespace xyz_tbl, drop
the tables, drop the tablespace, recreate the tablespace with a
different disk location and then finally reload the tables and data? Or
is there an easier way? Is there a move tablespace disk location
command?

Thanks,

Lance Campbell
Project Manager/Software Architect
Web Services at Public Affairs
University of Illinois
217.333.0382
http://webservices.uiuc.edu
My e-mail address has changed to lance(at)illinois(dot)edu

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Monday, May 26, 2008 10:09 AM
To: Campbell, Lance
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] Symbolic Links to Tablespaces

"Campbell, Lance" <lance(at)illinois(dot)edu> writes:
> I have started to define tablespaces on different disks. Is there any
> performance issues related to referencing tablespaces on different
disks
> with symbolic links? By using symbolic links to tablespaces can I
then
> stop the database and move a particular tablespace from one location
to
> another without causing a problem? This would seem to give a lot of
> flexibility to the location of tablespaces.

A tablespace already is a symbolic link --- read
http://www.postgresql.org/docs/8.2/static/storage.html

Putting another one into the path will eat cycles and doesn't seem like
it could buy anything.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message A. Kretschmer 2008-05-26 17:32:12 Re: Symbolic Links to Tablespaces
Previous Message Tom Lane 2008-05-26 15:36:57 Re: I/O on select count(*)