Mark ItemPointer parameters as const in tuple/table lock functions

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

From: Chao Li <li.evan.chao@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-08-27T08:57:31Z
Lists: pgsql-hackers

Attachments

Hi Hackers,

This is a pure refactor patch.

The functions LockTuple, ConditionalLockTuple, UnlockTuple, and
XactLockTableWait take an ItemPointer parameter named 'tid'. Since these
functions do not modify the tuple identifier, the parameter should be
declared as const to better convey intent and allow the compiler to enforce
immutability.

With this patch, build still passes, and "make check" also passes.

Best regards,

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

Commits

  1. Mark ItemPointer arguments as const in tuple/table lock functions