98
98
#define RELATION_CHECKS \
99
99
( \
100
100
AssertMacro(RelationIsValid(indexRelation)), \
101
- AssertMacro(PointerIsValid(indexRelation->rd_amroutine )), \
101
+ AssertMacro(PointerIsValid(indexRelation->rd_indam )), \
102
102
AssertMacro(!ReindexIsProcessingIndex(RelationGetRelid(indexRelation))) \
103
103
)
104
104
105
105
#define SCAN_CHECKS \
106
106
( \
107
107
AssertMacro(IndexScanIsValid(scan)), \
108
108
AssertMacro(RelationIsValid(scan->indexRelation)), \
109
- AssertMacro(PointerIsValid(scan->indexRelation->rd_amroutine )) \
109
+ AssertMacro(PointerIsValid(scan->indexRelation->rd_indam )) \
110
110
)
111
111
112
112
#define CHECK_REL_PROCEDURE (pname ) \
113
113
do { \
114
- if (indexRelation->rd_amroutine ->pname == NULL) \
114
+ if (indexRelation->rd_indam ->pname == NULL) \
115
115
elog(ERROR, "function %s is not defined for index %s", \
116
116
CppAsString(pname), RelationGetRelationName(indexRelation)); \
117
117
} while(0)
118
118
119
119
#define CHECK_SCAN_PROCEDURE (pname ) \
120
120
do { \
121
- if (scan->indexRelation->rd_amroutine ->pname == NULL) \
121
+ if (scan->indexRelation->rd_indam ->pname == NULL) \
122
122
elog(ERROR, "function %s is not defined for index %s", \
123
123
CppAsString(pname), RelationGetRelationName(scan->indexRelation)); \
124
124
} while(0)
@@ -203,14 +203,14 @@ index_insert(Relation indexRelation,
203
203
RELATION_CHECKS ;
204
204
CHECK_REL_PROCEDURE (aminsert );
205
205
206
- if (!(indexRelation -> rd_amroutine -> ampredlocks ))
206
+ if (!(indexRelation -> rd_indam -> ampredlocks ))
207
207
CheckForSerializableConflictIn (indexRelation ,
208
208
(HeapTuple ) NULL ,
209
209
InvalidBuffer );
210
210
211
- return indexRelation -> rd_amroutine -> aminsert (indexRelation , values , isnull ,
212
- heap_t_ctid , heapRelation ,
213
- checkUnique , indexInfo );
211
+ return indexRelation -> rd_indam -> aminsert (indexRelation , values , isnull ,
212
+ heap_t_ctid , heapRelation ,
213
+ checkUnique , indexInfo );
214
214
}
215
215
216
216
/*
@@ -275,7 +275,7 @@ index_beginscan_internal(Relation indexRelation,
275
275
RELATION_CHECKS ;
276
276
CHECK_REL_PROCEDURE (ambeginscan );
277
277
278
- if (!(indexRelation -> rd_amroutine -> ampredlocks ))
278
+ if (!(indexRelation -> rd_indam -> ampredlocks ))
279
279
PredicateLockRelation (indexRelation , snapshot );
280
280
281
281
/*
@@ -286,8 +286,8 @@ index_beginscan_internal(Relation indexRelation,
286
286
/*
287
287
* Tell the AM to open a scan.
288
288
*/
289
- scan = indexRelation -> rd_amroutine -> ambeginscan (indexRelation , nkeys ,
290
- norderbys );
289
+ scan = indexRelation -> rd_indam -> ambeginscan (indexRelation , nkeys ,
290
+ norderbys );
291
291
/* Initialize information for parallel scan. */
292
292
scan -> parallel_scan = pscan ;
293
293
scan -> xs_temp_snap = temp_snap ;
@@ -329,8 +329,8 @@ index_rescan(IndexScanDesc scan,
329
329
330
330
scan -> kill_prior_tuple = false; /* for safety */
331
331
332
- scan -> indexRelation -> rd_amroutine -> amrescan (scan , keys , nkeys ,
333
- orderbys , norderbys );
332
+ scan -> indexRelation -> rd_indam -> amrescan (scan , keys , nkeys ,
333
+ orderbys , norderbys );
334
334
}
335
335
336
336
/* ----------------
@@ -351,7 +351,7 @@ index_endscan(IndexScanDesc scan)
351
351
}
352
352
353
353
/* End the AM's scan */
354
- scan -> indexRelation -> rd_amroutine -> amendscan (scan );
354
+ scan -> indexRelation -> rd_indam -> amendscan (scan );
355
355
356
356
/* Release index refcount acquired by index_beginscan */
357
357
RelationDecrementReferenceCount (scan -> indexRelation );
@@ -373,7 +373,7 @@ index_markpos(IndexScanDesc scan)
373
373
SCAN_CHECKS ;
374
374
CHECK_SCAN_PROCEDURE (ammarkpos );
375
375
376
- scan -> indexRelation -> rd_amroutine -> ammarkpos (scan );
376
+ scan -> indexRelation -> rd_indam -> ammarkpos (scan );
377
377
}
378
378
379
379
/* ----------------
@@ -404,7 +404,7 @@ index_restrpos(IndexScanDesc scan)
404
404
405
405
scan -> kill_prior_tuple = false; /* for safety */
406
406
407
- scan -> indexRelation -> rd_amroutine -> amrestrpos (scan );
407
+ scan -> indexRelation -> rd_indam -> amrestrpos (scan );
408
408
}
409
409
410
410
/*
@@ -430,9 +430,9 @@ index_parallelscan_estimate(Relation indexRelation, Snapshot snapshot)
430
430
* AM-specific data needed. (It's hard to believe that could work, but
431
431
* it's easy enough to cater to it here.)
432
432
*/
433
- if (indexRelation -> rd_amroutine -> amestimateparallelscan != NULL )
433
+ if (indexRelation -> rd_indam -> amestimateparallelscan != NULL )
434
434
nbytes = add_size (nbytes ,
435
- indexRelation -> rd_amroutine -> amestimateparallelscan ());
435
+ indexRelation -> rd_indam -> amestimateparallelscan ());
436
436
437
437
return nbytes ;
438
438
}
@@ -465,12 +465,12 @@ index_parallelscan_initialize(Relation heapRelation, Relation indexRelation,
465
465
SerializeSnapshot (snapshot , target -> ps_snapshot_data );
466
466
467
467
/* aminitparallelscan is optional; assume no-op if not provided by AM */
468
- if (indexRelation -> rd_amroutine -> aminitparallelscan != NULL )
468
+ if (indexRelation -> rd_indam -> aminitparallelscan != NULL )
469
469
{
470
470
void * amtarget ;
471
471
472
472
amtarget = OffsetToPointer (target , offset );
473
- indexRelation -> rd_amroutine -> aminitparallelscan (amtarget );
473
+ indexRelation -> rd_indam -> aminitparallelscan (amtarget );
474
474
}
475
475
}
476
476
@@ -484,8 +484,8 @@ index_parallelrescan(IndexScanDesc scan)
484
484
SCAN_CHECKS ;
485
485
486
486
/* amparallelrescan is optional; assume no-op if not provided by AM */
487
- if (scan -> indexRelation -> rd_amroutine -> amparallelrescan != NULL )
488
- scan -> indexRelation -> rd_amroutine -> amparallelrescan (scan );
487
+ if (scan -> indexRelation -> rd_indam -> amparallelrescan != NULL )
488
+ scan -> indexRelation -> rd_indam -> amparallelrescan (scan );
489
489
}
490
490
491
491
/*
@@ -539,7 +539,7 @@ index_getnext_tid(IndexScanDesc scan, ScanDirection direction)
539
539
* scan->xs_recheck and possibly scan->xs_itup/scan->xs_hitup, though we
540
540
* pay no attention to those fields here.
541
541
*/
542
- found = scan -> indexRelation -> rd_amroutine -> amgettuple (scan , direction );
542
+ found = scan -> indexRelation -> rd_indam -> amgettuple (scan , direction );
543
543
544
544
/* Reset kill flag immediately for safety */
545
545
scan -> kill_prior_tuple = false;
@@ -724,7 +724,7 @@ index_getbitmap(IndexScanDesc scan, TIDBitmap *bitmap)
724
724
/*
725
725
* have the am's getbitmap proc do all the work.
726
726
*/
727
- ntids = scan -> indexRelation -> rd_amroutine -> amgetbitmap (scan , bitmap );
727
+ ntids = scan -> indexRelation -> rd_indam -> amgetbitmap (scan , bitmap );
728
728
729
729
pgstat_count_index_tuples (scan -> indexRelation , ntids );
730
730
@@ -751,8 +751,8 @@ index_bulk_delete(IndexVacuumInfo *info,
751
751
RELATION_CHECKS ;
752
752
CHECK_REL_PROCEDURE (ambulkdelete );
753
753
754
- return indexRelation -> rd_amroutine -> ambulkdelete (info , stats ,
755
- callback , callback_state );
754
+ return indexRelation -> rd_indam -> ambulkdelete (info , stats ,
755
+ callback , callback_state );
756
756
}
757
757
758
758
/* ----------------
@@ -770,7 +770,7 @@ index_vacuum_cleanup(IndexVacuumInfo *info,
770
770
RELATION_CHECKS ;
771
771
CHECK_REL_PROCEDURE (amvacuumcleanup );
772
772
773
- return indexRelation -> rd_amroutine -> amvacuumcleanup (info , stats );
773
+ return indexRelation -> rd_indam -> amvacuumcleanup (info , stats );
774
774
}
775
775
776
776
/* ----------------
@@ -786,10 +786,10 @@ index_can_return(Relation indexRelation, int attno)
786
786
RELATION_CHECKS ;
787
787
788
788
/* amcanreturn is optional; assume false if not provided by AM */
789
- if (indexRelation -> rd_amroutine -> amcanreturn == NULL )
789
+ if (indexRelation -> rd_indam -> amcanreturn == NULL )
790
790
return false;
791
791
792
- return indexRelation -> rd_amroutine -> amcanreturn (indexRelation , attno );
792
+ return indexRelation -> rd_indam -> amcanreturn (indexRelation , attno );
793
793
}
794
794
795
795
/* ----------------
@@ -827,7 +827,7 @@ index_getprocid(Relation irel,
827
827
int nproc ;
828
828
int procindex ;
829
829
830
- nproc = irel -> rd_amroutine -> amsupport ;
830
+ nproc = irel -> rd_indam -> amsupport ;
831
831
832
832
Assert (procnum > 0 && procnum <= (uint16 ) nproc );
833
833
@@ -861,7 +861,7 @@ index_getprocinfo(Relation irel,
861
861
int nproc ;
862
862
int procindex ;
863
863
864
- nproc = irel -> rd_amroutine -> amsupport ;
864
+ nproc = irel -> rd_indam -> amsupport ;
865
865
866
866
Assert (procnum > 0 && procnum <= (uint16 ) nproc );
867
867
0 commit comments