Re: HowTo move indices' files to other hdd ? - Mailing list pgsql-general

From scott.marlowe
Subject Re: HowTo move indices' files to other hdd ?
Date
Msg-id Pine.LNX.4.44.0207151402080.29139-100000@css120.ihs.com
Whole thread Raw
In response to HowTo move indices' files to other hdd ?  (Vitaliy Pylypiv <pylypiv@hotbox.ru>)
List pgsql-general
On Mon, 15 Jul 2002, Vitaliy Pylypiv wrote:

> Hi all!
>
> Is it possible to move  indices' files to other hdd ?

Yes.  Here's what you need to do:

first, go to the postgresql-7.x.x/contrib/oid2name directory (as root) and
do a make;make install so you have the oid2name utility installed.

then, do:

oid2name | grep dbname

where dbname is the name of the database you want to move an index around
on.  You should get a line like 10964230 = dbname back..

As the postgres superuser, do:

cd $PGDATA/base/oidfromoid2nameabove  (i.e. 10964230 in my example)

Next do:

oid2name -d dbname|grep indexname

to get the oid of the index.

Then, shutdown the server and cp your index elsewhere:

pg_ctl stop
cp 10965165 /mnt/indexdisk/10965165
rm 10965165
ln -s /mnt/indexdisk/10965165
pg_ctl start

And that's that.


pgsql-general by date:

Previous
From: nconway@klamath.dyndns.org (Neil Conway)
Date:
Subject: Re: Question: merit / feasibility of compressing frontend <--> backend transfers w/ zlib
Next
From: Robert Treat
Date:
Subject: table size growing out of control