Mark ItemPointer parameters as const in tuple/table lock functions

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Mark ItemPointer parameters as const in tuple/table lock functions
Date: 2025-08-27 08:57:31
Message-ID: CAEoWx2m9e4rECHBwpRE4+GCH+pbYZXLh2f4rB1Du5hDfKug+Og@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

Attachment Content-Type Size
v1-0001-Mark-ItemPointer-parameters-as-const-in-tuple-tab.patch application/octet-stream 3.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-08-27 09:24:18 Re: Mark ItemPointer parameters as const in tuple/table lock functions
Previous Message Mihail Nikalayeu 2025-08-27 08:53:57 Re: [BUG?] check_exclusion_or_unique_constraint false negative