Adjust btree index build procedure so that the btree metapage looks

Tom Lane <tgl@sss.pgh.pa.us>

Commit: e33f205a945e7497b9aecffffb7e3b0a199f8a29
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2003-09-29T23:40:26Z
Releases: 7.4.1
Adjust btree index build procedure so that the btree metapage looks
invalid (has the wrong magic number) until the build is entirely
complete.  This turns out to cost no additional writes in the normal
case, since we were rewriting the metapage at the end of the process
anyway.  In normal scenarios there's no real gain in security, because
a failed index build would roll back the transaction leaving an unused
index file, but for rebuilding shared system indexes this seems to add
some useful protection.

Files