nbtree: reduce code redundancy by using _bt_getmeta() in _bt_gettrueroot()

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-15T08:10:42Z
Lists: pgsql-hackers

Attachments

Hi Hackers,

I noticed this while reviewing [1]. _bt_gettrueroot() performs the same
metapage checks as _bt_getmeta(), so using _bt_getmeta() here removes the
duplicated code.

Build passed without warning and "make check" passed.

[1]
https://postgr.es/m/fvfmkr5kk4nyex56ejgxj3uzi63isfxovp2biecb4bspbjrze7@az2pljabhnff

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Commits

  1. Make heap TID a tiebreaker nbtree index column.