Marc Munro <marc(at)bloodnok(dot)com> writes:
> 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.
No, that's wrong. The missing ingredient is that the WAL log should
explicitly log table creations. (And also table drops.) If you look
you will find some comments showing the places where code is missing.
If you try to do it as you suggest above, then you will erroneously
recreate files that have been dropped.
regards, tom lane