Gavin Sherry <swm@linuxworld.com.au> writes:
> On Sun, 20 Jun 2004, Tom Lane wrote:
>> Maybe you have to dump each block into WAL as you copy it.
>> That would be kinda ugly ... though in point of fact less of a WAL load
>> than writing individual tuples ...
> Should I use the WAL-enabled case of _bt_blwritepage() as a guide here?
Yeah, actually that is a very good parallel. If PITR archiving isn't
turned on, you don't have to dump pages into WAL; you can substitute
an fsync before commit, instead. And if it's a temp table then you
don't have to do either. (Not sure anyone would ever do SET TABLESPACE
on a temp table, but might as well get it right.)
The xlog action here of copying a page image is currently
btree-specific, but maybe we should move it to a more widely visible
place, such as heapam.c. I don't see any value in having identical
xlog recovery actions in several different modules.
regards, tom lane