33#define SizeForSortShimExtra(nargs) (offsetof(SortShimExtra, fcinfo) + SizeForFunctionCallInfo(nargs))
96 Oid sortSupportFunction;
118 elog(
ERROR,
"missing support function %d(%u,%u) in opfamily %u",
145 elog(
ERROR,
"operator %u is not a valid ordering operator",
169 if (indexRel->
rd_rel->relam != BTREE_AM_OID)
173 elog(
ERROR,
"unexpected sort support strategy: %d", strategy);
192 Oid sortSupportFunction;
196 if (indexRel->
rd_rel->relam != GIST_AM_OID)
207 elog(
ERROR,
"missing support function %d(%u,%u) in opfamily %u",
#define Assert(condition)
#define OidIsValid(objectId)
void fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
#define OidFunctionCall1(functionId, arg1)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define FunctionCallInvoke(fcinfo)
#define GIST_SORTSUPPORT_PROC
Oid get_opfamily_proc(Oid opfamily, Oid lefttype, Oid righttype, int16 procnum)
bool get_ordering_op_properties(Oid opno, Oid *opfamily, Oid *opcintype, int16 *strategy)
void * MemoryContextAlloc(MemoryContext context, Size size)
#define BTSORTSUPPORT_PROC
static Datum PointerGetDatum(const void *X)
static int comparison_shim(Datum x, Datum y, SortSupport ssup)
void PrepareSortSupportFromGistIndexRel(Relation indexRel, SortSupport ssup)
static void FinishSortSupportFunction(Oid opfamily, Oid opcintype, SortSupport ssup)
void PrepareSortSupportComparisonShim(Oid cmpFunc, SortSupport ssup)
void PrepareSortSupportFromOrderingOp(Oid orderingOp, SortSupport ssup)
#define SizeForSortShimExtra(nargs)
void PrepareSortSupportFromIndexRel(Relation indexRel, int16 strategy, SortSupport ssup)
#define BTGreaterStrategyNumber
#define BTLessStrategyNumber
NullableDatum args[FLEXIBLE_ARRAY_MEMBER]
int(* comparator)(Datum x, Datum y, SortSupport ssup)