185 Datum *result,
bool *isnull);
190 Datum *result,
bool *isnull);
213 int relpos,
int seektype,
214 bool set_mark,
bool *isnull,
217 int64 abs_pos,
bool *isnull,
222 int64 pos,
int argno);
224 int64 pos,
int argno);
226 int64 pos,
int argno,
bool isnull);
231#define NN_UNKNOWN 0x00
233#define NN_NOTNULL 0x02
235#define NN_BITS_PER_MEMBER 2
237#define NN_ITEM_PER_VAR (BITS_PER_BYTE / NN_BITS_PER_MEMBER)
239#define NN_POS_TO_BYTES(pos) ((pos) / NN_ITEM_PER_VAR)
241#define NN_BYTES_TO_POS(bytes) ((bytes) * NN_ITEM_PER_VAR)
243#define NN_SHIFT(pos) ((pos) % NN_ITEM_PER_VAR) * NN_BITS_PER_MEMBER
321 &fcinfo->args[
i].isnull);
332 for (
i = 1;
i <= numArguments;
i++)
334 if (fcinfo->args[
i].isnull)
385 (
Node *) winstate, NULL);
386 fcinfo->args[0].value = peraggstate->
transValue;
398 (
errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
399 errmsg(
"moving-aggregate transition function must not return null")));
498 &fcinfo->args[
i].isnull);
509 for (
i = 1;
i <= numArguments;
i++)
511 if (fcinfo->args[
i].isnull)
531 elog(
ERROR,
"aggregate transition value is NULL before inverse transition");
556 (
Node *) winstate, NULL);
557 fcinfo->args[0].value = peraggstate->
transValue;
628 Datum *result,
bool *isnull)
647 (
Node *) winstate, NULL);
648 fcinfo->args[0].value =
656 for (
i = 1;
i < numFinalArgs;
i++)
658 fcinfo->args[
i].value = (
Datum) 0;
659 fcinfo->args[
i].isnull =
true;
663 if (fcinfo->flinfo->fn_strict && anynull)
673 winstate->curaggcontext = peraggstate->
aggcontext;
675 winstate->curaggcontext = NULL;
676 *isnull = fcinfo->isnull;
713 int64 aggregatedupto_nonrestarted;
781 elog(
ERROR,
"window frame head moved backward");
801 for (
i = 0;
i < numaggs;
i++)
803 peraggstate = &winstate->
peragg[
i];
804 wfuncno = peraggstate->
wfuncno;
827 for (
i = 0;
i < numaggs;
i++)
829 peraggstate = &winstate->
peragg[
i];
850 while (numaggs_restart < numaggs &&
859 elog(
ERROR,
"could not re-fetch previously fetched frame row");
868 for (
i = 0;
i < numaggs;
i++)
872 peraggstate = &winstate->
peragg[
i];
876 wfuncno = peraggstate->
wfuncno;
920 if (numaggs_restart > 0)
922 for (
i = 0;
i < numaggs;
i++)
924 peraggstate = &winstate->
peragg[
i];
928 numaggs_restart == 0 ||
933 wfuncno = peraggstate->
wfuncno;
958 if (numaggs_restart > 0 &&
989 agg_row_slot,
false);
999 for (
i = 0;
i < numaggs;
i++)
1001 peraggstate = &winstate->
peragg[
i];
1008 wfuncno = peraggstate->
wfuncno;
1024 Assert(aggregatedupto_nonrestarted <= winstate->aggregatedupto);
1029 for (
i = 0;
i < numaggs;
i++)
1034 peraggstate = &winstate->
peragg[
i];
1035 wfuncno = peraggstate->
wfuncno;
1078 Datum *result,
bool *isnull)
1096 for (
int argno = 0; argno < perfuncstate->
numArguments; argno++)
1097 fcinfo->args[argno].isnull =
true;
1102 *isnull = fcinfo->isnull;
1155 int readptr_flags = 0;
1175 for (
int i = 0;
i < numfuncs;
i++)
1300 for (
int i = 0;
i < numfuncs;
i++)
1317 for (
int j = 0;
j < numargs;
j++)
1445 if (perfuncstate->
winobj)
1499 if (pos < winstate->frameheadpos)
1573 if (pos < winstate->grouptailpos)
1645 elog(
ERROR,
"unexpected end of tuplestore");
1698 int sortCol = node->ordColIdx[0];
1726 elog(
ERROR,
"unexpected end of tuplestore");
1740 if (headisnull || currisnull)
1746 if (!headisnull || currisnull)
1752 if (headisnull || !currisnull)
1802 elog(
ERROR,
"unexpected end of tuplestore");
1898 elog(
ERROR,
"unexpected end of tuplestore");
1952 int sortCol = node->ordColIdx[0];
1980 elog(
ERROR,
"unexpected end of tuplestore");
1994 if (tailisnull || currisnull)
2056 elog(
ERROR,
"unexpected end of tuplestore");
2172 (
errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
2173 errmsg(
"frame starting offset must not be null")));
2186 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
2187 errmsg(
"frame starting offset must not be negative")));
2199 (
errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
2200 errmsg(
"frame ending offset must not be null")));
2213 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
2214 errmsg(
"frame ending offset must not be negative")));
2328 elog(
ERROR,
"unexpected end of tuplestore");
2342 elog(
ERROR,
"unexpected end of tuplestore");
2352 for (
i = 0;
i < numfuncs;
i++)
2434 for (
i = 0;
i < numfuncs;
i++)
2541 "WindowAgg Partition",
2552 "WindowAgg Aggregates",
2645 node->partOperators,
2646 node->partCollations,
2655 node->ordCollations,
2673 winstate->
peragg = peragg;
2677 foreach(l, winstate->
funcs)
2686 elog(
ERROR,
"WindowFunc with winref %u assigned to WindowAgg with winref %u",
2693 for (
i = 0;
i <= wfuncno;
i++)
2695 if (
equal(wfunc, perfunc[
i].wfunc) &&
2699 if (i <= wfuncno && wfunc->ignore_nulls == perfunc[
i].ignore_nulls)
2707 perfuncstate = &perfunc[++wfuncno];
2710 wfuncstate->
wfuncno = wfuncno;
2722 perfuncstate->
wfunc = wfunc;
2734 perfuncstate->
plain_agg = wfunc->winagg;
2739 perfuncstate->
aggno = ++aggno;
2740 peraggstate = &winstate->
peragg[aggno];
2742 peraggstate->
wfuncno = wfuncno;
2751 perfuncstate->
winobj = winobj;
2764 winstate->
numaggs = aggno + 1;
2816 if (node->
buffer != NULL)
2912 foreach(lc, wfunc->
args)
2919 elog(
ERROR,
"cache lookup failed for aggregate %u",
2942 use_ma_code =
false;
2943 else if (aggform->aggmfinalmodify == AGGMODIFY_READ_ONLY &&
2944 aggform->aggfinalmodify != AGGMODIFY_READ_ONLY)
2947 use_ma_code =
false;
2949 use_ma_code =
false;
2951 use_ma_code =
false;
2956 peraggstate->
transfn_oid = transfn_oid = aggform->aggmtransfn;
2957 peraggstate->
invtransfn_oid = invtransfn_oid = aggform->aggminvtransfn;
2958 peraggstate->
finalfn_oid = finalfn_oid = aggform->aggmfinalfn;
2959 finalextra = aggform->aggmfinalextra;
2960 finalmodify = aggform->aggmfinalmodify;
2961 aggtranstype = aggform->aggmtranstype;
2962 initvalAttNo = Anum_pg_aggregate_aggminitval;
2966 peraggstate->
transfn_oid = transfn_oid = aggform->aggtransfn;
2968 peraggstate->
finalfn_oid = finalfn_oid = aggform->aggfinalfn;
2969 finalextra = aggform->aggfinalextra;
2970 finalmodify = aggform->aggfinalmodify;
2971 aggtranstype = aggform->aggtranstype;
2972 initvalAttNo = Anum_pg_aggregate_agginitval;
2988 elog(
ERROR,
"cache lookup failed for function %u",
2993 aclresult =
object_aclcheck(ProcedureRelationId, transfn_oid, aggOwner,
3002 aclresult =
object_aclcheck(ProcedureRelationId, invtransfn_oid, aggOwner,
3012 aclresult =
object_aclcheck(ProcedureRelationId, finalfn_oid, aggOwner,
3026 if (finalmodify != AGGMODIFY_READ_ONLY)
3028 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3029 errmsg(
"aggregate function %s does not support use as a window function",
3109 if (numArguments < 1 ||
3112 (
errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
3113 errmsg(
"aggregate %u needs to have compatible input type and transition type",
3128 (
errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
3129 errmsg(
"strictness of aggregate's forward and inverse transition functions must match")));
3148 "WindowAgg Per Aggregate",
3191 econtext->ecxt_outertuple = slot1;
3192 econtext->ecxt_innertuple = slot2;
3222 if (pos < winobj->markpos)
3223 elog(
ERROR,
"cannot fetch row before WindowObject's mark position");
3232 if (winobj->
seekpos < pos - 1)
3237 elog(
ERROR,
"unexpected end of tuplestore");
3240 else if (winobj->
seekpos > pos + 1)
3245 elog(
ERROR,
"unexpected end of tuplestore");
3248 else if (winobj->
seekpos == pos)
3272 elog(
ERROR,
"unexpected end of tuplestore");
3278 elog(
ERROR,
"unexpected end of tuplestore");
3295 int64 abs_pos,
bool *isnull,
bool *isout)
3328 int relpos,
int seektype,
bool set_mark,
3329 bool *isnull,
bool *isout)
3347 notnull_relpos = abs(relpos);
3352 elog(
ERROR,
"WINDOW_SEEK_CURRENT is not supported for WinGetFuncArgInFrame");
3353 abs_pos = mark_pos = 0;
3374 elog(
ERROR,
"unrecognized window seek type: %d", seektype);
3375 abs_pos = mark_pos = 0;
3400 else if (inframe == 0)
3429 if (notnull_offset > notnull_relpos)
3444 }
while (notnull_offset <= notnull_relpos);
3485#define INIT_NOT_NULL_INFO_NUM 128
3507 newsize = oldsize * 2;
3561 mb |= (
val << shift);
3579 bool allowNullTreatment,
3588 elog(
ERROR,
"could not get function name");
3590 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3591 errmsg(
"function %s does not allow RESPECT/IGNORE NULLS",
3666 if (markpos < winobj->markpos)
3667 elog(
ERROR,
"cannot move WindowObject's mark position backward");
3669 if (markpos > winobj->
markpos)
3677 if (markpos > winobj->
seekpos)
3724 res =
are_peers(winstate, slot1, slot2);
3752 int relpos,
int seektype,
bool set_mark,
3753 bool *isnull,
bool *isout)
3759 bool null_treatment;
3789 elog(
ERROR,
"unrecognized window seek type: %d", seektype);
3795 if (!null_treatment)
3799 abs_pos, isnull, &myisout);
3800 if (!myisout && set_mark)
3809 notnull_relpos = abs(relpos);
3810 forward = relpos > 0 ? 1 : -1;
3863 abs_pos, isnull, &myisout);
3871 }
while (notnull_offset < notnull_relpos);
3875 abs_pos, isnull, &myisout);
3876 if (!myisout && set_mark)
3919 int relpos,
int seektype,
bool set_mark,
3920 bool *isnull,
bool *isout)
3935 set_mark, isnull, isout);
3940 elog(
ERROR,
"WINDOW_SEEK_CURRENT is not supported for WinGetFuncArgInFrame");
3941 abs_pos = mark_pos = 0;
3992 if (abs_pos == overlapstart)
3999 elog(
ERROR,
"unrecognized frame option state: 0x%x",
4027 if (abs_pos <= winstate->currentpos &&
4031 if (abs_pos < winstate->frameheadpos)
4037 if (abs_pos < winstate->grouptailpos &&
4046 if (abs_pos < winstate->frameheadpos)
4052 if (abs_pos < winstate->grouptailpos &&
4058 if (abs_pos == overlapend - 1)
4064 if (abs_pos < winstate->frameheadpos)
4069 elog(
ERROR,
"unrecognized frame option state: 0x%x",
4076 elog(
ERROR,
"unrecognized window seek type: %d", seektype);
4077 abs_pos = mark_pos = 0;
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult object_aclcheck(Oid classid, Oid objectid, Oid roleid, AclMode mode)
#define TextDatumGetCString(d)
#define MemSet(start, val, len)
#define OidIsValid(objectId)
bool contain_subplans(Node *clause)
bool contain_volatile_functions(Node *clause)
Datum datumCopy(Datum value, bool typByVal, int typLen)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
bool equal(const void *a, const void *b)
void ExecReScan(PlanState *node)
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
ExprState * ExecInitQual(List *qual, PlanState *parent)
ExprState * execTuplesMatchPrepare(TupleDesc desc, int numCols, const AttrNumber *keyColIdx, const Oid *eqOperators, const Oid *collations, PlanState *parent)
void ExecEndNode(PlanState *node)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
const TupleTableSlotOps TTSOpsVirtual
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
void ExecInitResultTupleSlotTL(PlanState *planstate, const TupleTableSlotOps *tts_ops)
const TupleTableSlotOps TTSOpsMinimalTuple
void ExecCreateScanSlotFromOuterPlan(EState *estate, ScanState *scanstate, const TupleTableSlotOps *tts_ops)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
void ExecAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc)
struct WindowStatePerAggData * WindowStatePerAgg
#define InstrCountFiltered1(node, delta)
#define outerPlanState(node)
@ WINDOWAGG_PASSTHROUGH_STRICT
struct WindowStatePerFuncData * WindowStatePerFunc
#define EXEC_FLAG_BACKWARD
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
#define ResetExprContext(econtext)
static bool ExecQual(ExprState *state, ExprContext *econtext)
static bool ExecQualAndReset(ExprState *state, ExprContext *econtext)
static TupleTableSlot * ExecProcNode(PlanState *node)
static Datum ExecEvalExpr(ExprState *state, ExprContext *econtext, bool *isNull)
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
ExpandedObjectHeader * DatumGetEOHP(Datum d)
void DeleteExpandedObject(Datum d)
#define MakeExpandedObjectReadOnly(d, isnull, typlen)
#define DatumIsReadWriteExpandedObject(d, isnull, typlen)
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
Datum FunctionCall5Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5)
void fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define LOCAL_FCINFO(name, nargs)
#define FunctionCallInvoke(fcinfo)
#define fmgr_info_set_expr(expr, finfo)
Assert(PointerIsAligned(start, uint64))
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
if(TABLE==NULL||TABLE_index==NULL)
void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
char * get_func_name(Oid funcid)
void * repalloc0(void *pointer, Size oldsize, Size size)
void MemoryContextReset(MemoryContext context)
void * MemoryContextAllocZero(MemoryContext context, Size size)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
MemoryContext MemoryContextGetParent(MemoryContext context)
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define CHECK_FOR_INTERRUPTS()
Oid exprType(const Node *expr)
Datum WinGetFuncArgInPartition(WindowObject winobj, int argno, int relpos, int seektype, bool set_mark, bool *isnull, bool *isout)
void * WinGetPartitionLocalMemory(WindowObject winobj, Size sz)
static void grow_notnull_info(WindowObject winobj, int64 pos, int argno)
#define INIT_NOT_NULL_INFO_NUM
static void begin_partition(WindowAggState *winstate)
struct WindowObjectData WindowObjectData
static void update_grouptailpos(WindowAggState *winstate)
Datum WinGetFuncArgInFrame(WindowObject winobj, int argno, int relpos, int seektype, bool set_mark, bool *isnull, bool *isout)
static TupleTableSlot * ExecWindowAgg(PlanState *pstate)
struct WindowStatePerAggData WindowStatePerAggData
static void init_notnull_info(WindowObject winobj, WindowStatePerFunc perfuncstate)
static Datum GetAggInitVal(Datum textInitVal, Oid transtype)
static void spool_tuples(WindowAggState *winstate, int64 pos)
static void advance_windowaggregate(WindowAggState *winstate, WindowStatePerFunc perfuncstate, WindowStatePerAgg peraggstate)
void ExecEndWindowAgg(WindowAggState *node)
static void eval_windowfunction(WindowAggState *winstate, WindowStatePerFunc perfuncstate, Datum *result, bool *isnull)
struct WindowStatePerFuncData WindowStatePerFuncData
static void put_notnull_info(WindowObject winobj, int64 pos, int argno, bool isnull)
static Datum ignorenulls_getfuncarginframe(WindowObject winobj, int argno, int relpos, int seektype, bool set_mark, bool *isnull, bool *isout)
static WindowStatePerAggData * initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, WindowStatePerAgg peraggstate)
static void finalize_windowaggregate(WindowAggState *winstate, WindowStatePerFunc perfuncstate, WindowStatePerAgg peraggstate, Datum *result, bool *isnull)
static bool advance_windowaggregate_base(WindowAggState *winstate, WindowStatePerFunc perfuncstate, WindowStatePerAgg peraggstate)
static bool window_gettupleslot(WindowObject winobj, int64 pos, TupleTableSlot *slot)
static pg_noinline void prepare_tuplestore(WindowAggState *winstate)
void ExecReScanWindowAgg(WindowAggState *node)
int64 WinGetCurrentPosition(WindowObject winobj)
WindowAggState * ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags)
bool WinRowsArePeers(WindowObject winobj, int64 pos1, int64 pos2)
static pg_noinline void calculate_frame_offsets(PlanState *pstate)
#define NN_BYTES_TO_POS(bytes)
void WinSetMarkPosition(WindowObject winobj, int64 markpos)
static void eval_windowaggregates(WindowAggState *winstate)
static uint8 get_notnull_info(WindowObject winobj, int64 pos, int argno)
#define NN_POS_TO_BYTES(pos)
static int row_is_in_frame(WindowObject winobj, int64 pos, TupleTableSlot *slot, bool fetch_tuple)
static void release_partition(WindowAggState *winstate)
static Datum gettuple_eval_partition(WindowObject winobj, int argno, int64 abs_pos, bool *isnull, bool *isout)
static void update_frametailpos(WindowAggState *winstate)
static void update_frameheadpos(WindowAggState *winstate)
static void initialize_windowaggregate(WindowAggState *winstate, WindowStatePerFunc perfuncstate, WindowStatePerAgg peraggstate)
void WinCheckAndInitializeNullTreatment(WindowObject winobj, bool allowNullTreatment, FunctionCallInfo fcinfo)
static bool are_peers(WindowAggState *winstate, TupleTableSlot *slot1, TupleTableSlot *slot2)
Datum WinGetFuncArgCurrent(WindowObject winobj, int argno, bool *isnull)
int64 WinGetPartitionRowCount(WindowObject winobj)
#define castNode(_type_, nodeptr)
#define InvokeFunctionExecuteHook(objectId)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
void build_aggregate_finalfn_expr(Oid *agg_input_types, int num_finalfn_inputs, Oid agg_state_type, Oid agg_result_type, Oid agg_input_collation, Oid finalfn_oid, Expr **finalfnexpr)
Oid resolve_aggregate_transtype(Oid aggfuncid, Oid aggtranstype, Oid *inputTypes, int numArguments)
void build_aggregate_transfn_expr(Oid *agg_input_types, int agg_num_inputs, int agg_num_direct_inputs, bool agg_variadic, Oid agg_state_type, Oid agg_input_collation, Oid transfn_oid, Oid invtransfn_oid, Expr **transfnexpr, Expr **invtransfnexpr)
bool IsBinaryCoercible(Oid srctype, Oid targettype)
#define FRAMEOPTION_END_CURRENT_ROW
#define FRAMEOPTION_END_OFFSET
#define FRAMEOPTION_EXCLUDE_CURRENT_ROW
#define FRAMEOPTION_END_OFFSET_PRECEDING
#define FRAMEOPTION_START_UNBOUNDED_PRECEDING
#define FRAMEOPTION_START_CURRENT_ROW
#define FRAMEOPTION_START_OFFSET
#define FRAMEOPTION_EXCLUDE_TIES
#define FRAMEOPTION_RANGE
#define FRAMEOPTION_EXCLUDE_GROUP
#define FRAMEOPTION_GROUPS
#define FRAMEOPTION_END_UNBOUNDED_FOLLOWING
#define FRAMEOPTION_START_OFFSET_PRECEDING
#define FRAMEOPTION_EXCLUSION
FormData_pg_aggregate * Form_pg_aggregate
static int list_length(const List *l)
static void * list_nth(const List *list, int n)
FormData_pg_proc * Form_pg_proc
static bool DatumGetBool(Datum X)
static int64 DatumGetInt64(Datum X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
#define PARSER_IGNORE_NULLS
char * format_procedure(Oid procedure_oid)
MemoryContext ecxt_per_tuple_memory
TupleTableSlot * ecxt_innertuple
TupleTableSlot * ecxt_scantuple
MemoryContext ecxt_per_query_memory
TupleTableSlot * ecxt_outertuple
const TupleTableSlotOps * outerops
ExprContext * ps_ExprContext
ProjectionInfo * ps_ProjInfo
ExecProcNodeMtd ExecProcNode
TupleTableSlot * ss_ScanTupleSlot
TupleDesc tts_tupleDescriptor
MemoryContext partcontext
TupleTableSlot * framehead_slot
FmgrInfo startInRangeFunc
TupleTableSlot * frametail_slot
ExprState * ordEqfunction
TupleTableSlot * temp_slot_2
TupleTableSlot * agg_row_slot
struct WindowObjectData * agg_winobj
WindowStatePerFunc perfunc
MemoryContext curaggcontext
ExprState * partEqfunction
TupleTableSlot * first_part_slot
TupleTableSlot * temp_slot_1
WindowAggState * winstate
WindowFuncExprState * wfuncstate
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
bool tuplestore_gettupleslot(Tuplestorestate *state, bool forward, bool copy, TupleTableSlot *slot)
void tuplestore_puttupleslot(Tuplestorestate *state, TupleTableSlot *slot)
void tuplestore_select_read_pointer(Tuplestorestate *state, int ptr)
void tuplestore_clear(Tuplestorestate *state)
int tuplestore_alloc_read_pointer(Tuplestorestate *state, int eflags)
Tuplestorestate * tuplestore_begin_heap(bool randomAccess, bool interXact, int maxKBytes)
void tuplestore_trim(Tuplestorestate *state)
bool tuplestore_advance(Tuplestorestate *state, bool forward)
bool tuplestore_in_memory(Tuplestorestate *state)
void tuplestore_end(Tuplestorestate *state)
void tuplestore_set_eflags(Tuplestorestate *state, int eflags)
bool tuplestore_skiptuples(Tuplestorestate *state, int64 ntuples, bool forward)
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)
static TupleTableSlot * ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
#define WindowObjectIsValid(winobj)
#define WINDOW_SEEK_CURRENT