"Tom Lane" <tgl@sss.pgh.pa.us> writes
> > Since there is no xlog replay mechanism to CREATE INDEX (bottom-up
method),
> > so CREATE INDEX won't get replayed in PITR?
>
> On what do you base either part of that statement?
>
I see _bt_load() still relies on smgrimmedsync() to assure a correct disk
image of the btree after a crash.
As you found out, this won't work if we do a CREATE DATABASE + CREATE INDEX
and system crashes. If you forced a checkpoint, then CREATE DATABASE won't
get replayed after the crashed, so the btree disk image is still there, then
the problem is solved in this case.
However, if we take a physical copy of the database, then do CREATE DATABASE
+ CREATE INDEX again, and we want to rollforward, from my understanding of
current _bt_load() code, I don't see anywhere to get the btree disk image
again.
Regards,
Qingqing