@@ -213,6 +213,12 @@ lsm3_truncate_index(Oid index_oid, Oid heap_oid)
213
213
table_close (heap , AccessShareLock );
214
214
}
215
215
216
+ #if PG_VERSION_NUM >=140000
217
+ #define INSERT_FLAGS UNIQUE_CHECK_NO, false
218
+ #else
219
+ #define INSERT_FLAGS false
220
+ #endif
221
+
216
222
/* Merge top index into base index */
217
223
static void
218
224
lsm3_merge_indexes (Oid dst_oid , Oid src_oid , Oid heap_oid )
@@ -247,14 +253,14 @@ lsm3_merge_indexes(Oid dst_oid, Oid src_oid, Oid heap_oid)
247
253
unsigned short save_info = itup -> t_info ;
248
254
itup -> t_info = (save_info & ~(INDEX_SIZE_MASK | INDEX_ALT_TID_MASK )) + BTreeTupleGetPostingOffset (itup );
249
255
itup -> t_tid = scan -> xs_heaptid ;
250
- _bt_doinsert (base_index , itup , false , heap ); /* lsm3 index is not unique so need not to heck for duplica
256
+ _bt_doinsert (base_index , itup , INSERT_FLAGS , heap ); /* lsm3 index is not unique so need not to heck for duplica
251
257
tes */
252
258
itup -> t_tid = save_tid ;
253
259
itup -> t_info = save_info ;
254
260
}
255
261
else
256
262
{
257
- _bt_doinsert (base_index , itup , false , heap ); /* lsm3 index is not unique so need not to heck for duplica
263
+ _bt_doinsert (base_index , itup , INSERT_FLAGS , heap ); /* lsm3 index is not unique so need not to heck for duplica
258
264
tes */
259
265
}
260
266
}
@@ -435,6 +441,9 @@ static bool
435
441
lsm3_insert (Relation rel , Datum * values , bool * isnull ,
436
442
ItemPointer ht_ctid , Relation heapRel ,
437
443
IndexUniqueCheck checkUnique ,
444
+ #if PG_VERSION_NUM >=140000
445
+ bool indexUnchanged ,
446
+ #endif
438
447
IndexInfo * indexInfo )
439
448
{
440
449
Lsm3DictEntry * entry = lsm3_get_entry (rel );
@@ -457,7 +466,11 @@ lsm3_insert(Relation rel, Datum *values, bool *isnull,
457
466
index = index_open (entry -> top [active_index ], RowExclusiveLock );
458
467
index -> rd_rel -> relam = BTREE_AM_OID ;
459
468
save_am = index -> rd_rel -> relam ;
460
- btinsert (index , values , isnull , ht_ctid , heapRel , checkUnique , indexInfo );
469
+ btinsert (index , values , isnull , ht_ctid , heapRel , checkUnique ,
470
+ #if PG_VERSION_NUM >=140000
471
+ indexUnchanged ,
472
+ #endif
473
+ indexInfo );
461
474
index_close (index , RowExclusiveLock );
462
475
index -> rd_rel -> relam = save_am ;
463
476
@@ -755,6 +768,9 @@ static bool
755
768
lsm3_dummy_insert (Relation rel , Datum * values , bool * isnull ,
756
769
ItemPointer ht_ctid , Relation heapRel ,
757
770
IndexUniqueCheck checkUnique ,
771
+ #if PG_VERSION_NUM >=140000
772
+ bool indexUnchanged ,
773
+ #endif
758
774
IndexInfo * indexInfo )
759
775
{
760
776
return false;
0 commit comments