Using symbolic links with tablespaces

From: miller_2555 <nabble(dot)30(dot)miller_2555(at)spamgourmet(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Using symbolic links with tablespaces
Date: 2009-09-08 20:45:55
Message-ID: 25353894.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Frankel 2009-09-08 21:25:20 where clauses and multiple tables
Previous Message Alvaro Herrera 2009-09-08 20:12:20 Re: PG connections going to 'waiting'