]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Don't use bits32 in table AM interface
authorÁlvaro Herrera <alvherre@kurilemu.de>
Mon, 30 Mar 2026 17:03:28 +0000 (19:03 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Mon, 30 Mar 2026 17:06:33 +0000 (19:06 +0200)
Seems there's near-universal dislike for the bitsXX typedefs.
Revert that part of commit 1bd6f22f43ac in favor of using plain uint32.

src/backend/access/heap/heapam.c
src/backend/access/heap/heapam_handler.c
src/include/access/heapam.h
src/include/access/tableam.h

index 882deda6b954cc0fb172e1c024fd630a165813eb..4db4a2068ee5f3e997928564753488ae6d0a305e 100644 (file)
@@ -57,7 +57,7 @@
 
 
 static HeapTuple heap_prepare_insert(Relation relation, HeapTuple tup,
-                                                                        TransactionId xid, CommandId cid, bits32 options);
+                                                                        TransactionId xid, CommandId cid, uint32 options);
 static XLogRecPtr log_heap_update(Relation reln, Buffer oldbuf,
                                                                  Buffer newbuf, HeapTuple oldtup,
                                                                  HeapTuple newtup, HeapTuple old_key_tuple,
@@ -2148,7 +2148,7 @@ ReleaseBulkInsertStatePin(BulkInsertState bistate)
  */
 void
 heap_insert(Relation relation, HeapTuple tup, CommandId cid,
-                       bits32 options, BulkInsertState bistate)
+                       uint32 options, BulkInsertState bistate)
 {
        TransactionId xid = GetCurrentTransactionId();
        HeapTuple       heaptup;
@@ -2339,7 +2339,7 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
  */
 static HeapTuple
 heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid,
-                                       CommandId cid, bits32 options)
+                                       CommandId cid, uint32 options)
 {
        /*
         * To allow parallel inserts, we need to ensure that they are safe to be
@@ -2419,7 +2419,7 @@ heap_multi_insert_pages(HeapTuple *heaptuples, int done, int ntuples, Size saveF
  */
 void
 heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples,
-                                 CommandId cid, bits32 options, BulkInsertState bistate)
+                                 CommandId cid, uint32 options, BulkInsertState bistate)
 {
        TransactionId xid = GetCurrentTransactionId();
        HeapTuple  *heaptuples;
index 4de1eab4a732590cf137bcf37afb9d2dfa156427..e63b12c3c6127adc39b15dc9b33d7df56fd6f60a 100644 (file)
@@ -253,7 +253,7 @@ heapam_tuple_satisfies_snapshot(Relation rel, TupleTableSlot *slot,
 
 static void
 heapam_tuple_insert(Relation relation, TupleTableSlot *slot, CommandId cid,
-                                       bits32 options, BulkInsertState bistate)
+                                       uint32 options, BulkInsertState bistate)
 {
        bool            shouldFree = true;
        HeapTuple       tuple = ExecFetchSlotHeapTuple(slot, true, &shouldFree);
@@ -272,7 +272,7 @@ heapam_tuple_insert(Relation relation, TupleTableSlot *slot, CommandId cid,
 
 static void
 heapam_tuple_insert_speculative(Relation relation, TupleTableSlot *slot,
-                                                               CommandId cid, bits32 options,
+                                                               CommandId cid, uint32 options,
                                                                BulkInsertState bistate, uint32 specToken)
 {
        bool            shouldFree = true;
index 4e982d768891b5ce274074a74b456ef5544a189d..696b1f49a9d0a3d96d92723628b217f8f0a448eb 100644 (file)
@@ -376,9 +376,9 @@ extern void FreeBulkInsertState(BulkInsertState);
 extern void ReleaseBulkInsertStatePin(BulkInsertState bistate);
 
 extern void heap_insert(Relation relation, HeapTuple tup, CommandId cid,
-                                               bits32 options, BulkInsertState bistate);
+                                               uint32 options, BulkInsertState bistate);
 extern void heap_multi_insert(Relation relation, TupleTableSlot **slots,
-                                                         int ntuples, CommandId cid, bits32 options,
+                                                         int ntuples, CommandId cid, uint32 options,
                                                          BulkInsertState bistate);
 extern TM_Result heap_delete(Relation relation, const ItemPointerData *tid,
                                                         CommandId cid, Snapshot crosscheck, bool wait,
index cd14f242d65e7e591d51865f58a0456c30517be3..e0d27afa876eeeaeb2a104ee4cee15b87ef7b33d 100644 (file)
@@ -530,14 +530,14 @@ typedef struct TableAmRoutine
 
        /* see table_tuple_insert() for reference about parameters */
        void            (*tuple_insert) (Relation rel, TupleTableSlot *slot,
-                                                                CommandId cid, bits32 options,
+                                                                CommandId cid, uint32 options,
                                                                 BulkInsertStateData *bistate);
 
        /* see table_tuple_insert_speculative() for reference about parameters */
        void            (*tuple_insert_speculative) (Relation rel,
                                                                                         TupleTableSlot *slot,
                                                                                         CommandId cid,
-                                                                                        bits32 options,
+                                                                                        uint32 options,
                                                                                         BulkInsertStateData *bistate,
                                                                                         uint32 specToken);
 
@@ -549,7 +549,7 @@ typedef struct TableAmRoutine
 
        /* see table_multi_insert() for reference about parameters */
        void            (*multi_insert) (Relation rel, TupleTableSlot **slots, int nslots,
-                                                                CommandId cid, bits32 options, BulkInsertStateData *bistate);
+                                                                CommandId cid, uint32 options, BulkInsertStateData *bistate);
 
        /* see table_tuple_delete() for reference about parameters */
        TM_Result       (*tuple_delete) (Relation rel,
@@ -596,7 +596,7 @@ typedef struct TableAmRoutine
         *
         * Optional callback.
         */
-       void            (*finish_bulk_insert) (Relation rel, bits32 options);
+       void            (*finish_bulk_insert) (Relation rel, uint32 options);
 
 
        /* ------------------------------------------------------------------------
@@ -1440,7 +1440,7 @@ table_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
  */
 static inline void
 table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid,
-                                  bits32 options, BulkInsertStateData *bistate)
+                                  uint32 options, BulkInsertStateData *bistate)
 {
        rel->rd_tableam->tuple_insert(rel, slot, cid, options,
                                                                  bistate);
@@ -1459,7 +1459,7 @@ table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid,
  */
 static inline void
 table_tuple_insert_speculative(Relation rel, TupleTableSlot *slot,
-                                                          CommandId cid, bits32 options,
+                                                          CommandId cid, uint32 options,
                                                           BulkInsertStateData *bistate,
                                                           uint32 specToken)
 {
@@ -1495,7 +1495,7 @@ table_tuple_complete_speculative(Relation rel, TupleTableSlot *slot,
  */
 static inline void
 table_multi_insert(Relation rel, TupleTableSlot **slots, int nslots,
-                                  CommandId cid, bits32 options, BulkInsertStateData *bistate)
+                                  CommandId cid, uint32 options, BulkInsertStateData *bistate)
 {
        rel->rd_tableam->multi_insert(rel, slots, nslots,
                                                                  cid, options, bistate);
@@ -1636,7 +1636,7 @@ table_tuple_lock(Relation rel, ItemPointer tid, Snapshot snapshot,
  * tuple_insert and multi_insert with a BulkInsertState specified.
  */
 static inline void
-table_finish_bulk_insert(Relation rel, bits32 options)
+table_finish_bulk_insert(Relation rel, uint32 options)
 {
        /* optional callback */
        if (rel->rd_tableam && rel->rd_tableam->finish_bulk_insert)