pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Mark ItemPointer arguments as const in tuple/table lock function
2+ messages / 1 participants
[nested] [flat]

* pgsql: Mark ItemPointer arguments as const in tuple/table lock function
@ 2025-08-29 05:41  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2025-08-29 05:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Mark ItemPointer arguments as const in tuple/table lock functions

The functions LockTuple, ConditionalLockTuple, UnlockTuple, and
XactLockTableWait take an ItemPointer argument that they do not
modify, so the argument can be const-qualified to better convey intent
and allow the compiler to enforce immutability.

Author: Chao Li <li.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAEoWx2m9e4rECHBwpRE4%2BGCH%2BpbYZXLh2f4rB1Du5hDfKug%2BOg...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/991295f387a6a453fe061831bcc36294989fe77b

Modified Files
--------------
src/backend/storage/lmgr/lmgr.c | 10 +++++-----
src/include/storage/lmgr.h      |  8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Mark ItemPointer arguments as const throughout
@ 2025-10-30 13:18  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2025-10-30 13:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Mark ItemPointer arguments as const throughout

This is a follow up 991295f.  I searched over src/ and made all
ItemPointer arguments as const as much as possible.

Note: We cut out from the original patch the pieces that would have
created incompatibilities in the index or table AM APIs.  Those could
be considered separately.

Author: Chao Li <li.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAEoWx2nBaypg16Z5ciHuKw66pk850RFWw9ACS2DqqJ_AkKeRsw%40mail.gma...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e1ac846f3d2836dcfa0ad15310e28d0a0b495500

Modified Files
--------------
src/backend/access/common/tidstore.c       |  2 +-
src/backend/access/hash/hashsort.c         |  2 +-
src/backend/access/heap/heapam.c           | 34 +++++++++++++++---------------
src/backend/access/nbtree/nbtdedup.c       |  2 +-
src/backend/access/nbtree/nbtsearch.c      |  4 ++--
src/backend/access/nbtree/nbtsort.c        |  4 ++--
src/backend/access/nbtree/nbtsplitloc.c    |  4 ++--
src/backend/access/spgist/spgdoinsert.c    |  2 +-
src/backend/access/spgist/spgutils.c       |  2 +-
src/backend/access/spgist/spgvacuum.c      |  2 +-
src/backend/catalog/indexing.c             |  6 +++---
src/backend/executor/execIndexing.c        |  8 +++----
src/backend/storage/lmgr/predicate.c       |  8 +++----
src/backend/utils/adt/tid.c                |  6 +++---
src/backend/utils/sort/tuplesortvariants.c |  2 +-
src/include/access/hash.h                  |  2 +-
src/include/access/heapam.h                | 12 +++++------
src/include/access/nbtree.h                |  2 +-
src/include/access/spgist_private.h        |  4 ++--
src/include/access/tidstore.h              |  2 +-
src/include/catalog/index.h                |  2 +-
src/include/catalog/indexing.h             |  6 +++---
src/include/executor/executor.h            |  4 ++--
src/include/storage/predicate.h            |  4 ++--
src/include/utils/tuplesort.h              |  2 +-
25 files changed, 64 insertions(+), 64 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-10-30 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-08-29 05:41 pgsql: Mark ItemPointer arguments as const in tuple/table lock function Peter Eisentraut <peter@eisentraut.org>
2025-10-30 13:18 pgsql: Mark ItemPointer arguments as const throughout Peter Eisentraut <peter@eisentraut.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox