Re: [GENERAL] Storing database in WORM devices

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard_D_Levine(at)raytheon(dot)com
Cc: Alex Turner <armtuk(at)gmail(dot)com>, doug(at)mcnaught(dot)org, "GGoshen(at)axsone(dot)com" <GGoshen(at)axsone(dot)com>, pgsql-admin(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Storing database in WORM devices
Date: 2005-05-11 22:25:55
Message-ID: 24818.1115850355@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Richard_D_Levine(at)raytheon(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Chris Browne 2005-05-11 22:47:13 Re: [GENERAL] Storing database in WORM devices
Previous Message Enrico Weigelt 2005-05-11 22:25:48 Re: brute force attacking the password

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2005-05-11 22:47:13 Re: [GENERAL] Storing database in WORM devices
Previous Message Robert Treat 2005-05-11 21:47:16 Re: grant all privileges to all tables in a database