Re: How to store data on an external drive

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to store data on an external drive
Date: 2009-09-08 10:13:28
Message-ID: 20090908101328.GG5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 08, 2009 at 08:52:23AM +0000, Jasen Betts wrote:
> On 2009-09-08, Jia Chen <chen(dot)1002(at)gmail(dot)com> wrote:
> > 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.
>
> start again and install from the source.
> the ubuntu packge spreads the components of the postgres database about
> putting some in /usr/bin, /usr/lib, /etc/postgres, /var/log, /var/lib and /etc

I don't think you need to go that far. I'd just do an "initdb"
somewhere on the removable disk and then start PG pointing at where the
cluster was (i.e. postgres -D /media/disk/psqldata) and all should be
good. I'd stay away from the official system startup scripts for PG.

> you should install them all onto the removable drive instead.
> it's not just the table data that is needed need for the database to work.

Yup, the table data is very tied to the state of transactions and
other "system level" information, you need to keep everything together
unfortunately. This is the price of having transactions with ACID
semantics.

One other thing to note is that PG tends to change the on-disk format
between "major" versions, where a major version is defined as the second
digit changing. 8.3 and 8.2 are different major versions and have
different on-disk formats, while 8.3.6 and 8.3.7 are not.

--
Sam http://samason.me.uk/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Markus Pscheidt 2009-09-08 13:28:43 Re: Fail to start Postgres on Ubuntu kernel 2.6.28-15-generic
Previous Message Filip Rembiałkowski 2009-09-08 09:18:17 Re: Fail to start Postgres on Ubuntu kernel 2.6.28-15-generic