|
| typedef struct PlannerInfo | PlannerInfo |
| |
| typedef struct IndexPath | IndexPath |
| |
| typedef struct IndexInfo | IndexInfo |
| |
| typedef enum IndexAMProperty | IndexAMProperty |
| |
| typedef struct OpFamilyMember | OpFamilyMember |
| |
| typedef CompareType(* | amtranslate_strategy_function) (StrategyNumber strategy, Oid opfamily) |
| |
| typedef StrategyNumber(* | amtranslate_cmptype_function) (CompareType cmptype, Oid opfamily) |
| |
| typedef IndexBuildResult *(* | ambuild_function) (Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo) |
| |
| typedef void(* | ambuildempty_function) (Relation indexRelation) |
| |
| typedef bool(* | aminsert_function) (Relation indexRelation, Datum *values, bool *isnull, ItemPointer heap_tid, Relation heapRelation, IndexUniqueCheck checkUnique, bool indexUnchanged, IndexInfo *indexInfo) |
| |
| typedef void(* | aminsertcleanup_function) (Relation indexRelation, IndexInfo *indexInfo) |
| |
| typedef IndexBulkDeleteResult *(* | ambulkdelete_function) (IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state) |
| |
| typedef IndexBulkDeleteResult *(* | amvacuumcleanup_function) (IndexVacuumInfo *info, IndexBulkDeleteResult *stats) |
| |
| typedef bool(* | amcanreturn_function) (Relation indexRelation, int attno) |
| |
| typedef void(* | amcostestimate_function) (PlannerInfo *root, IndexPath *path, double loop_count, Cost *indexStartupCost, Cost *indexTotalCost, Selectivity *indexSelectivity, double *indexCorrelation, double *indexPages) |
| |
| typedef int(* | amgettreeheight_function) (Relation rel) |
| |
| typedef bytea *(* | amoptions_function) (Datum reloptions, bool validate) |
| |
| typedef bool(* | amproperty_function) (Oid index_oid, int attno, IndexAMProperty prop, const char *propname, bool *res, bool *isnull) |
| |
| typedef char *(* | ambuildphasename_function) (int64 phasenum) |
| |
| typedef bool(* | amvalidate_function) (Oid opclassoid) |
| |
| typedef void(* | amadjustmembers_function) (Oid opfamilyoid, Oid opclassoid, List *operators, List *functions) |
| |
| typedef IndexScanDesc(* | ambeginscan_function) (Relation indexRelation, int nkeys, int norderbys) |
| |
| typedef void(* | amrescan_function) (IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int norderbys) |
| |
| typedef bool(* | amgettuple_function) (IndexScanDesc scan, ScanDirection direction) |
| |
| typedef int64(* | amgetbitmap_function) (IndexScanDesc scan, TIDBitmap *tbm) |
| |
| typedef void(* | amendscan_function) (IndexScanDesc scan) |
| |
| typedef void(* | ammarkpos_function) (IndexScanDesc scan) |
| |
| typedef void(* | amrestrpos_function) (IndexScanDesc scan) |
| |
| typedef Size(* | amestimateparallelscan_function) (Relation indexRelation, int nkeys, int norderbys) |
| |
| typedef void(* | aminitparallelscan_function) (void *target) |
| |
| typedef void(* | amparallelrescan_function) (IndexScanDesc scan) |
| |
| typedef struct IndexAmRoutine | IndexAmRoutine |
| |
Definition at line 33 of file amapi.c.
34{
37
40
42 elog(
ERROR,
"index access method handler function %u did not return an IndexAmRoutine struct",
43 amhandler);
44
45
57
58 return routine;
59}
#define OidFunctionCall0(functionId)
Assert(PointerIsAligned(start, uint64))
#define IsA(nodeptr, _type_)
static Pointer DatumGetPointer(Datum X)
ambuildempty_function ambuildempty
amvacuumcleanup_function amvacuumcleanup
amoptions_function amoptions
aminsert_function aminsert
amendscan_function amendscan
amcostestimate_function amcostestimate
ambulkdelete_function ambulkdelete
amvalidate_function amvalidate
ambeginscan_function ambeginscan
amrescan_function amrescan
References IndexAmRoutine::ambeginscan, IndexAmRoutine::ambuild, IndexAmRoutine::ambuildempty, IndexAmRoutine::ambulkdelete, IndexAmRoutine::amcostestimate, IndexAmRoutine::amendscan, IndexAmRoutine::aminsert, IndexAmRoutine::amoptions, IndexAmRoutine::amrescan, IndexAmRoutine::amvacuumcleanup, IndexAmRoutine::amvalidate, Assert(), DatumGetPointer(), elog, ERROR, IsA, and OidFunctionCall0.
Referenced by CheckIndexCompatible(), DefineIndex(), GetIndexAmRoutineByAmId(), InitIndexAmRoutine(), and pg_get_indexdef_worker().
Definition at line 69 of file amapi.c.
70{
74
75
78 {
79 if (noerror)
80 return NULL;
81 elog(
ERROR,
"cache lookup failed for access method %u",
82 amoid);
83 }
85
86
87 if (amform->amtype != AMTYPE_INDEX)
88 {
89 if (noerror)
90 {
92 return NULL;
93 }
95 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
96 errmsg(
"access method \"%s\" is not of type %s",
97 NameStr(amform->amname),
"INDEX")));
98 }
99
100 amhandler = amform->amhandler;
101
102
104 {
105 if (noerror)
106 {
108 return NULL;
109 }
111 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
112 errmsg(
"index access method \"%s\" does not have a handler",
114 }
115
117
118
120}
IndexAmRoutine * GetIndexAmRoutine(Oid amhandler)
#define RegProcedureIsValid(p)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
FormData_pg_am * Form_pg_am
static Datum ObjectIdGetDatum(Oid X)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
References elog, ereport, errcode(), errmsg(), ERROR, GetIndexAmRoutine(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), RegProcedureIsValid, ReleaseSysCache(), and SearchSysCache1().
Referenced by AlterOpFamily(), AlterOpFamilyAdd(), amvalidate(), assignOperTypes(), assignProcTypes(), comparison_ops_are_compatible(), ConstructTupleDescriptor(), DefineOpClass(), equality_ops_are_compatible(), get_op_index_interpretation(), get_opmethod_canorder(), indexam_property(), IndexAmTranslateCompareType(), IndexAmTranslateStrategy(), IndexSupportsBackwardScan(), IsIndexUsableForReplicaIdentityFull(), and pg_indexam_progress_phasename().