Point in time recovery: recreating relation files

From: Marc Munro <marc(at)bloodnok(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Point in time recovery: recreating relation files
Date: 2002-02-28 00:39:58
Message-ID: 1014856798.19487.0.camel@bloodnok.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The current WAL recovery implementation does not recover newly created
objects such as tables. My suggested patch is:

When XLogOpenRelation fails to open the relation file, if errno is
ENOENT (no file or directory) we shuld attempt to recreate the file
using smgrcreate.

This seems to work fine for tables, indexes and sequences but can anyone
see any potential problems? I have not tried this with Toast tables;
are these handled any differently?

Is it reasonable to assume that recreating the file in this way is
safe? It seems OK to me as we only recreate the file if it does not
already exist, so we are not in danger of making a bad situation worse.

If no-one tells me this is a bad idea, I will submit a patch.

--
Marc marc(at)bloodnok(dot)com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc Munro 2002-02-28 00:40:07 Point in time recovery: archiving WAL files
Previous Message Hiroshi Inoue 2002-02-28 00:01:44 Re: eWeek Poll: Which database is most critical to your