34 #include "utils/fmgrprotos.h"
46 #define INCLUSION_MAX_PROCNUMS 4
47 #define PROCNUM_MERGE 11
48 #define PROCNUM_MERGEABLE 12
49 #define PROCNUM_CONTAINS 13
50 #define PROCNUM_EMPTY 14
57 #define PROCNUM_BASE 11
71 #define INCLUSION_UNION 0
72 #define INCLUSION_UNMERGEABLE 1
73 #define INCLUSION_CONTAINS_EMPTY 2
228 if (!attr->attbyval &&
234 result =
datumCopy(result, attr->attbyval, attr->attlen);
274 attno =
key->sk_attno;
275 subtype =
key->sk_subtype;
276 query =
key->sk_argument;
278 switch (
key->sk_strategy)
463 elog(
ERROR,
"invalid strategy number %d",
key->sk_strategy);
525 if (!attr->attbyval &&
531 result =
datumCopy(result, attr->attbyval, attr->attlen);
608 Assert(strategynum >= 1 &&
642 elog(
ERROR,
"missing operator %d(%u,%u) in opfamily %u",
643 strategynum, attr->atttypid, subtype, opfamily);
646 Anum_pg_amop_amopopr));
#define PROCNUM_MERGEABLE
Datum brin_inclusion_union(PG_FUNCTION_ARGS)
#define INCLUSION_UNMERGEABLE
Datum brin_inclusion_opcinfo(PG_FUNCTION_ARGS)
static FmgrInfo * inclusion_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, uint16 strategynum)
Datum brin_inclusion_consistent(PG_FUNCTION_ARGS)
Datum brin_inclusion_add_value(PG_FUNCTION_ARGS)
#define INCLUSION_MAX_PROCNUMS
struct InclusionOpaque InclusionOpaque
#define INCLUSION_CONTAINS_EMPTY
static FmgrInfo * inclusion_get_procinfo(BrinDesc *bdesc, uint16 attno, uint16 procnum)
#define SizeofBrinOpcInfo(ncols)
#define RegProcedureIsValid(p)
#define PG_USED_FOR_ASSERTS_ONLY
#define Assert(condition)
Datum datumCopy(Datum value, bool typByVal, int typLen)
Datum FunctionCall2Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2)
void fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
Datum FunctionCall1Coll(FmgrInfo *flinfo, Oid collation, Datum arg1)
void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo, MemoryContext destcxt)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_DATUM(n)
#define PG_GETARG_BOOL(n)
#define PG_RETURN_DATUM(x)
#define PG_RETURN_POINTER(x)
#define PG_GET_COLLATION()
#define PG_RETURN_BOOL(x)
#define HeapTupleIsValid(tuple)
FmgrInfo * index_getprocinfo(Relation irel, AttrNumber attnum, uint16 procnum)
RegProcedure index_getprocid(Relation irel, AttrNumber attnum, uint16 procnum)
if(TABLE==NULL||TABLE_index==NULL)
RegProcedure get_opcode(Oid opno)
void pfree(void *pointer)
void * palloc0(Size size)
FormData_pg_attribute * Form_pg_attribute
static bool DatumGetBool(Datum X)
static Oid DatumGetObjectId(Datum X)
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
#define RTSubStrategyNumber
#define RTOverlapStrategyNumber
#define RTLeftStrategyNumber
#define RTSubEqualStrategyNumber
#define RTSuperEqualStrategyNumber
#define RTOverRightStrategyNumber
#define RTRightStrategyNumber
#define RTSameStrategyNumber
#define RTEqualStrategyNumber
#define RTOverAboveStrategyNumber
#define RTMaxStrategyNumber
#define RTLessEqualStrategyNumber
#define RTGreaterEqualStrategyNumber
#define RTContainsStrategyNumber
#define RTOverBelowStrategyNumber
#define RTBelowStrategyNumber
#define RTGreaterStrategyNumber
#define RTSuperStrategyNumber
#define RTAboveStrategyNumber
#define RTOverLeftStrategyNumber
#define RTContainedByStrategyNumber
#define RTLessStrategyNumber
#define RTContainsElemStrategyNumber
#define RTAdjacentStrategyNumber
BrinOpcInfo * bd_info[FLEXIBLE_ARRAY_MEMBER]
TypeCacheEntry * oi_typcache[FLEXIBLE_ARRAY_MEMBER]
FmgrInfo extra_procinfos[INCLUSION_MAX_PROCNUMS]
FmgrInfo strategy_procinfos[RTMaxStrategyNumber]
bool extra_proc_missing[INCLUSION_MAX_PROCNUMS]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache4(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Datum SysCacheGetAttrNotNull(int cacheId, HeapTuple tup, AttrNumber attributeNumber)
#define TupleDescAttr(tupdesc, i)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)