Re: Re: Would a PostgreSQL database on a DVD be usable? - Mailing list pgsql-general

From Tom Lane
Subject Re: Re: Would a PostgreSQL database on a DVD be usable?
Date
Msg-id 24808.997135351@sss.pgh.pa.us
Whole thread Raw
In response to Re: Would a PostgreSQL database on a DVD be usable?  (Allan Engelhardt <allane@cybaea.com>)
Responses Re: Re: Would a PostgreSQL database on a DVD be usable?  (Andrew Gould <andrewgould@yahoo.com>)
List pgsql-general
Allan Engelhardt <allane@cybaea.com> writes:
> Peter Eisentraut wrote:
>> This won't work.  You need to be able to write to the medium for a number
>> of reasons.

> Is the reason that PostgreSQL must have log files etc. in the same
> directory as the data files

Look again --- they're *not* in the same directory as the data files.

I had interpreted Andrew's question as being about a read-mostly
storage medium, but you're probably right that he wanted it to be
read-only.

I believe it would work to copy individual table files to a read-only
medium after VACUUMing them.  You could copy a whole database directory
that way too, but only if you were willing to put up with a completely
read-only database (including no temp tables, for example).  It'd
probably make more sense to copy over just the biggest user tables to a
DVD, keeping the system tables on regular read/write media.  Right now
this requires hand mucking-about with symlinks for the moved-over
tables, but it's quite doable.  We have a TODO item to support
tablespaces, which'd make the bookkeeping a lot easier.

What definitely won't work is to put pg_log or the WAL files on
read-only media ...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: database does not exist in system catalog
Next
From: "Roderick A. Anderson"
Date:
Subject: Re: Would a PostgreSQL database on a DVD be usable?