Using symbolic links with tablespaces - Mailing list pgsql-general

From miller_2555
Subject Using symbolic links with tablespaces
Date
Msg-id 25353894.post@talk.nabble.com
Whole thread Raw
Responses Re: Using symbolic links with tablespaces  (miller_2555 <nabble.30.miller_2555@spamgourmet.com>)
List pgsql-general
Hi -
    I have a database and used symbolic links in the tablespace definitions.
I just wanted to validate that I can move the database objects to a
different physical volume by the following:
     1) issuing `pg_ctl stop`
     2) hard copying the tablespace files from one drive to another
     3) pointing the symbolic links to the new drive
     4) issuing `pg_ctl start`

A semi-complete example is as follows:

#> mount /dev/snn1 /mnt/myolddrive
#> mount /dev/sno1 /mnt/mynewdrive
#> cd /mnt
#> ln -s /mnt/myolddrive mypsqllink
#> pg_ctl start
#> psql mydb -c 'CREATE TABLESPACE "mytablespacename" OWNER wtadmin LOCATION
''/mnt/mypsqllink'';'
#> psql mydb -c 'CREATE TABLE "mytable" ("mycol" int) TABLESPACE
"mytablespacename";'
#> pg_ctl stop
#> cp -r ./myolddrive ./mynewdrive
#> rm mypsqllink
#> ln -s /mnt/mynewdrive mypsqllink
#> pg_ctl start

I would think this is okay, but want to double-check before running...

Thanks!

BTW -
Linux 2.6.27.29-170.2.78.fc10.x86_64 #1 SMP Fri Jul 31 04:16:20 EDT 2009
x86_64 GNU/Linux
psql (PostgreSQL) 8.3.7
--
View this message in context: http://www.nabble.com/Using-symbolic-links-with-tablespaces-tp25353894p25353894.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: PG connections going to 'waiting'
Next
From: Richard Broersma
Date:
Subject: Transaction Strategies for Natural Primary Keys & Cascading Updates