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)
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))
IndexAmRoutine * GetIndexAmRoutineByAmId(Oid amoid, bool noerror)
@ AMPROP_DISTANCE_ORDERABLE
static const struct am_propname am_propnames[]
static Datum indexam_property(FunctionCallInfo fcinfo, const char *propname, Oid amoid, Oid index_oid, int attno)
Datum pg_index_column_has_property(PG_FUNCTION_ARGS)
Datum pg_indexam_progress_phasename(PG_FUNCTION_ARGS)
Datum pg_index_has_property(PG_FUNCTION_ARGS)
Datum pg_indexam_has_property(PG_FUNCTION_ARGS)
static IndexAMProperty lookup_prop_name(const char *name)
static bool test_indoption(HeapTuple tuple, int attno, bool guard, int16 iopt_mask, int16 iopt_expect, bool *res)
#define CStringGetTextDatum(s)
#define OidIsValid(objectId)
static void PGresult * res
#define PG_GETARG_TEXT_PP(n)
#define PG_GETARG_INT32(n)
#define PG_RETURN_DATUM(x)
#define PG_RETURN_BOOL(x)
#define HeapTupleIsValid(tuple)
void index_close(Relation relation, LOCKMODE lockmode)
bool index_can_return(Relation indexRelation, int attno)
Relation index_open(Oid relationId, LOCKMODE lockmode)
Assert(fmt[strlen(fmt) - 1] !='\n')
FormData_pg_class * Form_pg_class
FormData_pg_index * Form_pg_index
int pg_strcasecmp(const char *s1, const char *s2)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
ambuildphasename_function ambuildphasename
amgettuple_function amgettuple
amcanreturn_function amcanreturn
amgetbitmap_function amgetbitmap
amproperty_function amproperty
int16 values[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
char * text_to_cstring(const text *t)