pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <maillist@candle.pha.pa.us>
To: Jan Wieck <jwieck@debis.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: bkruger@mindspring.com
Cc: pgsql-admin@postgreSQL.org
Cc: pgsql-general@postgreSQL.org
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [ADMIN] Re: [SQL] Data recovery
Date: Tue, 1 Jun 1999 13:28:39 -0400 (EDT)
Message-ID: <199906011728.NAA01606@candle.pha.pa.us> (raw)
In-Reply-To: <m10os8E-0003kLC@orion.SAPserv.Hamburg.dsh.de>

> > If you only have the data/base subdirectory, you will need to work
> > harder; you'll have to regenerate the top-level files.  I think if you
> > get pg_shadow and pg_database right you will be OK.  First, install and
> > initdb to get a basic set of files.  You will need to recall the old set
> > of users (including their userIDs) in order to reconstruct pg_shadow.
> > After you've done the createusers, issue a createdb for each old
> > database (subdirectory of base/) so that they have entries in
> > pg_database.  Then, shut down the postmaster, blow away the contents of
> > the base/ subdirectory and restore it from tape, and restart.  I think
> > it'll work...
> >
> > In any case it's critical to install the same Postgres version you
> > were using.
> 
>     NO  -  this  cannot  work.  He  surely  needs the entire data
>     directory because the information in the heap's relies on the
>     bits   in  data/pg_log.   And  that  info  (which  XID's  are
>     committed and which not) cannot  be  reconstructed  from  the
>     files - no chance.

Very, very hard, but not impossible.  If you update a row, and do a
select on that row, the select updates the transaction status so the
next select doesn't need to look at the pg_log table.  What this means
is that pg_log could probably be reconstructed from existing data, with
just 'unselected' changes not appearing properly.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (6+ messages)  latest in thread

Message-ID: <199906011728.NAA01606@candle.pha.pa.us>
Permalink:  ../199906011728.NAA01606@candle.pha.pa.us/
Also on:    postgresql.org/message-id/199906011728.NAA01606@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: maillist@candle.pha.pa.us, jwieck@debis.com, tgl@sss.pgh.pa.us, bkruger@mindspring.com, pgsql-admin@postgreSQL.org, pgsql-general@postgreSQL.org
  Subject: Re: [ADMIN] Re: [SQL] Data recovery
  In-Reply-To: <199906011728.NAA01606@candle.pha.pa.us>
  References: <m10os8E-0003kLC@orion.SAPserv.Hamburg.dsh.de> <199906011728.NAA01606@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox