94 for (i = 0; i <
lengthof(am_propnames); i++)
97 return am_propnames[i].
prop;
133 Anum_pg_index_indoption, &isnull);
137 indoption_val = indoption->
values[attno - 1];
139 *res = (indoption_val & iopt_mask) == iopt_expect;
155 const char *propname,
156 Oid amoid,
Oid index_oid,
int attno)
178 if (rd_rel->relkind != RELKIND_INDEX &&
179 rd_rel->relkind != RELKIND_PARTITIONED_INDEX)
184 amoid = rd_rel->relam;
185 natts = rd_rel->relnatts;
195 if (attno < 0 || attno > natts)
210 routine->
amproperty(index_oid, attno, prop, propname,
234 Assert(index_oid == rd_index->indexrelid);
235 Assert(attno > 0 && attno <= rd_index->indnatts);
245 && attno > rd_index->indnkeyatts)
253 INDOPTION_DESC, 0, &res))
260 INDOPTION_DESC, INDOPTION_DESC, &res))
267 INDOPTION_NULLS_FIRST, INDOPTION_NULLS_FIRST, &res))
274 INDOPTION_NULLS_FIRST, 0, &res))
static IndexAMProperty lookup_prop_name(const char *name)
#define PG_GETARG_INT32(n)
amgettuple_function amgettuple
amproperty_function amproperty
static const struct am_propname am_propnames[]
int pg_strcasecmp(const char *s1, const char *s2)
#define OidIsValid(objectId)
Datum pg_index_has_property(PG_FUNCTION_ARGS)
#define PG_GETARG_TEXT_PP(n)
bool index_can_return(Relation indexRelation, int attno)
amgetbitmap_function amgetbitmap
#define ObjectIdGetDatum(X)
IndexAmRoutine * GetIndexAmRoutineByAmId(Oid amoid, bool noerror)
static Datum indexam_property(FunctionCallInfo fcinfo, const char *propname, Oid amoid, Oid index_oid, int attno)
static bool test_indoption(HeapTuple tuple, int attno, bool guard, int16 iopt_mask, int16 iopt_expect, bool *res)
FormData_pg_index * Form_pg_index
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum pg_indexam_has_property(PG_FUNCTION_ARGS)
#define PG_RETURN_BOOL(x)
void ReleaseSysCache(HeapTuple tuple)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
#define PG_RETURN_TEXT_P(x)
#define HeapTupleIsValid(tuple)
#define Assert(condition)
ambuildphasename_function ambuildphasename
int16 values[FLEXIBLE_ARRAY_MEMBER]
Datum pg_index_column_has_property(PG_FUNCTION_ARGS)
void index_close(Relation relation, LOCKMODE lockmode)
#define DatumGetPointer(X)
char * text_to_cstring(const text *t)
FormData_pg_class * Form_pg_class
#define CStringGetTextDatum(s)
amcanreturn_function amcanreturn
Datum pg_indexam_progress_phasename(PG_FUNCTION_ARGS)
Relation index_open(Oid relationId, LOCKMODE lockmode)