How to store data on an external drive

Поиск
Список
Период
Сортировка
От Jia Chen
Тема How to store data on an external drive
Дата
Msg-id 4AA5A364.1080302@gmail.com
обсуждение исходный текст
Ответы Re: How to store data on an external drive  (Martin Gainty <mgainty@hotmail.com>)
Список pgsql-general
Hi there,

As a beginner of PostgreSQL, I installed PostgreSQL 8.3.7 on Ubuntu 9.04
by using sudo apt-get install.

Now, I want to store PostgreSQL data on an external drive because I work
both on my office machine and on my home machine a lot.  This way, I can
always bring my external drive to either location and work on data
stored on the drive.

I tried to use tablespaces as in
http://www.postgresql.org/docs/8.3/static/manage-ag-tablespaces.html.
But, it does not seem to work because once I create a tablespace located
at one folder in the external drive for one machine, I can not create a
tablespace located at the same folder on the other machine since the
folder is not empty any more.

Then, on my home machine, I copied everything in
/var/lib/postgresql/8.3/main to a folder on my external drive (say
folder /media/disk/psqldata) and edited postgresql.conf to comment out
line data_directory = '/var/lib/postgresql/8.3/main' and add
data_directory = '/media/disk/psqldata'. I am hoping that once I edit
postgresql.conf on my office machine the same way, it would work.  But,
my guess is that this won't work.

Please let me know whether this is right way to do it.  Please let me
know your way of doing it too.  Thanks.

Best,
Jia

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: More Snow Leopard problems...
Следующее
От: Martin Gainty
Дата:
Сообщение: Re: How to store data on an external drive