Re: [ADMIN] Storing database in WORM devices - Mailing list pgsql-general

From Tom Lane
Subject Re: [ADMIN] Storing database in WORM devices
Date
Msg-id 24818.1115850355@sss.pgh.pa.us
Whole thread Raw
In response to Re: [ADMIN] Storing database in WORM devices  (Richard_D_Levine@raytheon.com)
List pgsql-general
Richard_D_Levine@raytheon.com writes:
> Tom Lane suggested a vacuum freeze (? or something like that) for archival
> read only data.  I got the impression the template databases are freeze
> dried for freshness (good to the last bit?)  That feature might help as
> well in the transition from read-write to read-only.

Yes, you'd definitely need to do that before you could hope to put a
table on read-only storage.  Other issues to think about:
    - pg_xlog and pg_clog are NEVER read-only
    - temp files, which are normally made in a database's default
      tablespace

In PG 8.0 it should be pretty easy to vacuum freeze all the tables in a
tablespace (that is not the default tablespace of its database) and then
copy the tablespace directory tree to CD and hack the symlink for it.
I have not actually tried that but in theory it should work.  Don't
forget to checkpoint or stop the server before trying to copy files.

It might work to freeze a database's default tablespace in the same
way, if you first change the pgsql_tmp subdirectory into a symlink that
points somewhere that will be writable.  I'm not totally sure of this
though (the relcache init file in particular is something that could
burn you).

The main problem with any of this of course is the tight tie between
the read-only and read-write parts of the database.  You couldn't,
say, take the WORM device and mount it in another PG installation and
expect usable results.

            regards, tom lane

pgsql-general by date:

Previous
From: Robert Treat
Date:
Subject: Re: grant all privileges to all tables in a database
Next
From: Marc Munro
Date:
Subject: Need to determine how badly tables need vacuuming