34#ifndef __PG_SKIPLIST_H__
35#define __PG_SKIPLIST_H__
40#include <utils/palloc.h>
42#include "general/temporal.h"
58#define INPUT_AGG_TRANS_STATE(fcinfo, state) \
60 MemoryContext ctx = set_aggregation_context(fcinfo); \
61 state = PG_ARGISNULL(0) ? NULL : (SkipList *) PG_GETARG_POINTER(0); \
62 if (PG_ARGISNULL(1)) \
65 PG_RETURN_POINTER(state); \
69 unset_aggregation_context(ctx); \
72#define INPUT_AGG_COMB_STATE(fcinfo, state1, state2) \
74 MemoryContext ctx = set_aggregation_context(fcinfo); \
75 state1 = PG_ARGISNULL(0) ? NULL : (SkipList *) PG_GETARG_POINTER(0); \
76 state2 = PG_ARGISNULL(1) ? NULL : (SkipList *) PG_GETARG_POINTER(1); \
77 if (state1 == NULL && state2 == NULL) \
79 unset_aggregation_context(ctx); \
MemoryContext set_aggregation_context(FunctionCallInfo fcinfo)
Functions manipulating skiplists.
Definition: skiplist.c:65
void store_fcinfo(FunctionCallInfo fcinfo)
Store in the cache the fcinfo of the external function.
Definition: temporal.c:126
void unset_aggregation_context(MemoryContext ctx)
Switch to the given memory context.
Definition: skiplist.c:78
FunctionCallInfo fetch_fcinfo()
Skiplist data structure used for performing aggregates.
Definition: temporal.c:116