Add some const qualifications
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 27 Oct 2025 08:54:16 +0000 (09:54 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 27 Oct 2025 08:55:59 +0000 (09:55 +0100)
Add some const qualifications afforded by the previous change that
added a const qualification to PageAddItemExtended().

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Peter Geoghegan <pg@bowt.ie>
Discussion: https://www.postgresql.org/message-id/flat/c75cccf5-5709-407b-a36a-2ae6570be766@eisentraut.org

src/backend/access/brin/brin_pageops.c
src/backend/access/gin/ginfast.c
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtsort.c
src/include/access/brin_pageops.h

index b19c843132ce50d7d4ad807734788634828083c5..91a5ba163f2c6c0a59b2dcce7d9de6bac1ced1d0 100644 (file)
@@ -340,7 +340,7 @@ brin_can_do_samepage_update(Buffer buffer, Size origsz, Size newsz)
 OffsetNumber
 brin_doinsert(Relation idxrel, BlockNumber pagesPerRange,
                          BrinRevmap *revmap, Buffer *buffer, BlockNumber heapBlk,
-                         BrinTuple *tup, Size itemsz)
+                         const BrinTuple *tup, Size itemsz)
 {
        Page            page;
        BlockNumber blk;
index 5b28dde7541f0aa0bccbc7d4927ab8230bc951fe..33816f8551f1526d3066ae279f2a6287f399a33a 100644 (file)
@@ -57,7 +57,7 @@ typedef struct KeyArray
  */
 static int32
 writeListPage(Relation index, Buffer buffer,
-                         IndexTuple *tuples, int32 ntuples, BlockNumber rightlink)
+                         const IndexTuple *tuples, int32 ntuples, BlockNumber rightlink)
 {
        Page            page = BufferGetPage(buffer);
        int32           i,
index 42727e80c302bbb3952684d3c25493f2d07938b6..7c113c007e52beed5773f932d63aa34de4b0d0aa 100644 (file)
@@ -61,7 +61,7 @@ static Buffer _bt_split(Relation rel, Relation heaprel, BTScanInsert itup_key,
 static void _bt_insert_parent(Relation rel, Relation heaprel, Buffer buf,
                                                          Buffer rbuf, BTStack stack, bool isroot, bool isonly);
 static Buffer _bt_newlevel(Relation rel, Relation heaprel, Buffer lbuf, Buffer rbuf);
-static inline bool _bt_pgaddtup(Page page, Size itemsize, IndexTuple itup,
+static inline bool _bt_pgaddtup(Page page, Size itemsize, const IndexTupleData *itup,
                                                                OffsetNumber itup_off, bool newfirstdataitem);
 static void _bt_delete_or_dedup_one_page(Relation rel, Relation heapRel,
                                                                                 BTInsertState insertstate,
@@ -2634,7 +2634,7 @@ _bt_newlevel(Relation rel, Relation heaprel, Buffer lbuf, Buffer rbuf)
 static inline bool
 _bt_pgaddtup(Page page,
                         Size itemsize,
-                        IndexTuple itup,
+                        const IndexTupleData *itup,
                         OffsetNumber itup_off,
                         bool newfirstdataitem)
 {
index 6b618266a7f08efb188b7481459fa30e0f4d0752..313fe66bc96d7315022a1886677b0a16033d1c60 100644 (file)
@@ -266,7 +266,7 @@ static BulkWriteBuffer _bt_blnewpage(BTWriteState *wstate, uint32 level);
 static BTPageState *_bt_pagestate(BTWriteState *wstate, uint32 level);
 static void _bt_slideleft(Page rightmostpage);
 static void _bt_sortaddtup(Page page, Size itemsize,
-                                                  IndexTuple itup, OffsetNumber itup_off,
+                                                  const IndexTupleData *itup, OffsetNumber itup_off,
                                                   bool newfirstdataitem);
 static void _bt_buildadd(BTWriteState *wstate, BTPageState *state,
                                                 IndexTuple itup, Size truncextra);
@@ -716,7 +716,7 @@ _bt_slideleft(Page rightmostpage)
 static void
 _bt_sortaddtup(Page page,
                           Size itemsize,
-                          IndexTuple itup,
+                          const IndexTupleData *itup,
                           OffsetNumber itup_off,
                           bool newfirstdataitem)
 {
index be343767027fbcacdf0b2062003ffdd5ec9066a0..d3f7a11acb160b7f4b9e6779abbbdad2ec3ba134 100644 (file)
@@ -23,7 +23,7 @@ extern bool brin_can_do_samepage_update(Buffer buffer, Size origsz,
                                                                                Size newsz);
 extern OffsetNumber brin_doinsert(Relation idxrel, BlockNumber pagesPerRange,
                                                                  BrinRevmap *revmap, Buffer *buffer, BlockNumber heapBlk,
-                                                                 BrinTuple *tup, Size itemsz);
+                                                                 const BrinTuple *tup, Size itemsz);
 
 extern void brin_page_init(Page page, uint16 type);
 extern void brin_metapage_init(Page page, BlockNumber pagesPerRange,