The comments above _bt_doinsert() say at one point:
* This routine is called by the public interface routines, btbuild
* and btinsert. By here, itup is filled in, including the TID, in
* contrast with _bt_lockinsert() where the heap tuple is not yet
* inserted.
This is obsolete; since commit 89bda95d, only the insert public
interface routine calls _bt_doinsert().
--
Peter Geoghegan