32 #define RANGE_EMPTY_LITERAL "empty"
35 #define RangeTypeGetOid(r) ((r)->rangetypid)
38 #define RANGE_EMPTY 0x01
39 #define RANGE_LB_INC 0x02
40 #define RANGE_UB_INC 0x04
41 #define RANGE_LB_INF 0x08
42 #define RANGE_UB_INF 0x10
43 #define RANGE_LB_NULL 0x20
44 #define RANGE_UB_NULL 0x40
45 #define RANGE_CONTAIN_EMPTY 0x80
48 #define RANGE_HAS_LBOUND(flags) (!((flags) & (RANGE_EMPTY | \
52 #define RANGE_HAS_UBOUND(flags) (!((flags) & (RANGE_EMPTY | \
56 #define RangeIsEmpty(r) ((range_get_flags(r) & RANGE_EMPTY) != 0)
57 #define RangeIsOrContainsEmpty(r) \
58 ((range_get_flags(r) & (RANGE_EMPTY | RANGE_CONTAIN_EMPTY)) != 0)
91 #define PG_GETARG_RANGE_P(n) DatumGetRangeTypeP(PG_GETARG_DATUM(n))
92 #define PG_GETARG_RANGE_P_COPY(n) DatumGetRangeTypePCopy(PG_GETARG_DATUM(n))
93 #define PG_RETURN_RANGE_P(x) return RangeTypePGetDatum(x)
97 #define RANGESTRAT_BEFORE RTLeftStrategyNumber
98 #define RANGESTRAT_OVERLEFT RTOverLeftStrategyNumber
99 #define RANGESTRAT_OVERLAPS RTOverlapStrategyNumber
100 #define RANGESTRAT_OVERRIGHT RTOverRightStrategyNumber
101 #define RANGESTRAT_AFTER RTRightStrategyNumber
102 #define RANGESTRAT_ADJACENT RTSameStrategyNumber
103 #define RANGESTRAT_CONTAINS RTContainsStrategyNumber
104 #define RANGESTRAT_CONTAINED_BY RTContainedByStrategyNumber
105 #define RANGESTRAT_CONTAINS_ELEM RTContainsElemStrategyNumber
106 #define RANGESTRAT_EQ RTEqualStrategyNumber
147 struct Node *escontext);
155 struct Node *escontext);
#define PG_DETOAST_DATUM_COPY(datum)
#define PG_DETOAST_DATUM(datum)
Datum lower(PG_FUNCTION_ARGS)
Datum upper(PG_FUNCTION_ARGS)
static Datum PointerGetDatum(const void *X)
bool range_ne_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
int range_cmp_bounds(TypeCacheEntry *typcache, const RangeBound *b1, const RangeBound *b2)
bool range_split_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2, RangeType **output1, RangeType **output2)
bool range_contained_by_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
bool range_contains_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
bool range_after_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
bool bounds_adjacent(TypeCacheEntry *typcache, RangeBound boundA, RangeBound boundB)
bool range_overlaps_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
bool range_before_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
bool range_overright_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
bool range_contains_elem_internal(TypeCacheEntry *typcache, const RangeType *r, Datum val)
RangeType * range_minus_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2)
RangeType * make_range(TypeCacheEntry *typcache, RangeBound *lower, RangeBound *upper, bool empty, struct Node *escontext)
static Datum RangeTypePGetDatum(const RangeType *X)
void range_deserialize(TypeCacheEntry *typcache, const RangeType *range, RangeBound *lower, RangeBound *upper, bool *empty)
TypeCacheEntry * range_get_typcache(FunctionCallInfo fcinfo, Oid rngtypid)
bool range_eq_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
bool range_adjacent_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
void range_set_contain_empty(RangeType *range)
char range_get_flags(const RangeType *range)
RangeType * make_empty_range(TypeCacheEntry *typcache)
bool range_overleft_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
static RangeType * DatumGetRangeTypeP(Datum X)
int range_compare(const void *key1, const void *key2, void *arg)
static RangeType * DatumGetRangeTypePCopy(Datum X)
RangeType * range_union_internal(TypeCacheEntry *typcache, RangeType *r1, RangeType *r2, bool strict)
RangeType * range_intersect_internal(TypeCacheEntry *typcache, const RangeType *r1, const RangeType *r2)
int range_cmp_bound_values(TypeCacheEntry *typcache, const RangeBound *b1, const RangeBound *b2)
RangeType * range_serialize(TypeCacheEntry *typcache, RangeBound *lower, RangeBound *upper, bool empty, struct Node *escontext)
static struct cvec * range(struct vars *v, chr a, chr b, int cases)