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

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: nbtree: reduce code redundancy by using _bt_getmeta() in _bt_gettrueroot()
Date: 2026-01-15 08:10:42
Message-ID: CAEoWx2nisjqs4iC9o4Hu7-Ab767=cMZZzmhBGb8SaQtMMmVqPQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

Attachment Content-Type Size
v1-0001-nbtree-deduplicate-metapage-sanity-checks-in-_bt_.patch application/octet-stream 1.9 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2026-01-15 08:20:37 Re: GIN pageinspect support for entry tree and posting tree
Previous Message Michael Paquier 2026-01-15 08:09:08 Re: Extended Statistics set/restore/clear functions.