Point in time recovery: recreating relation files - Mailing list pgsql-hackers

From Marc Munro
Subject Point in time recovery: recreating relation files
Date
Msg-id 1014856798.19487.0.camel@bloodnok.com
Whole thread Raw
Responses Re: Point in time recovery: recreating relation files  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@bloodnok.com


pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: eWeek Poll: Which database is most critical to your
Next
From: Marc Munro
Date:
Subject: Point in time recovery: archiving WAL files