It seems that in implementing ginbuildempty(), I falsified the first "note" in the header comment for log_newpage():
* Note: all current callers build pages in private memory and write them * directly to smgr, rather than using bufmgr. Therefore there is no need * to pass a buffer ID to XLogInsert, nor to perform MarkBufferDirty within * the critical section. Mea culpa, mea culpa, mea maxima culpa. So, this leads to a couple of questions: 1. Considering that we're logging the entire page, is it necessary (or even desirable) to include the buffer ID in the rdata structure? If so, why? To put that another way, does my abuse of log_newpage constitute a bug in gistbuildempty()? 2. Should we add a new function that does the same thing as log_newpage for a shared buffer? I'm imagining that the signature would be: XLogRecPtr log_newpage_buffer(RelFileNode *rnode, Buffer buffer); Admittedly, it may seem that we don't quite need such a function to cater to just one caller, but I think we might have more in the future. Among other things, it occurs to me to wonder whether I ought to rewrite all the ambuildempty routines in the style of ginbuildempty(), to avoid having to fsync in the foreground. Even if not, I think there might be other applications for this. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers