PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/tupmacs.h"
#include "common/hashfn.h"
#include "funcapi.h"
#include "lib/stringinfo.h"
#include "libpq/pqformat.h"
#include "nodes/nodes.h"
#include "port/pg_bitutils.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/multirangetypes.h"
#include "utils/rangetypes.h"
Go to the source code of this file.
Data Structures | |
struct | MultirangeIOData |
Macros | |
#define | MultirangeGetItemsPtr(mr) |
#define | MultirangeGetFlagsPtr(mr) |
#define | MultirangeGetBoundariesPtr(mr, align) |
#define | MULTIRANGE_ITEM_OFF_BIT 0x80000000 |
#define | MULTIRANGE_ITEM_GET_OFFLEN(item) ((item) & 0x7FFFFFFF) |
#define | MULTIRANGE_ITEM_HAS_OFF(item) ((item) & MULTIRANGE_ITEM_OFF_BIT) |
#define | MULTIRANGE_ITEM_OFFSET_STRIDE 4 |
Typedefs | |
typedef struct MultirangeIOData | MultirangeIOData |
typedef int(* | multirange_bsearch_comparison) (TypeCacheEntry *typcache, RangeBound *lower, RangeBound *upper, void *key, bool *match) |
#define MULTIRANGE_ITEM_GET_OFFLEN | ( | item | ) | ((item) & 0x7FFFFFFF) |
Definition at line 81 of file multirangetypes.c.
#define MULTIRANGE_ITEM_HAS_OFF | ( | item | ) | ((item) & MULTIRANGE_ITEM_OFF_BIT) |
Definition at line 82 of file multirangetypes.c.
#define MULTIRANGE_ITEM_OFF_BIT 0x80000000 |
Definition at line 80 of file multirangetypes.c.
#define MULTIRANGE_ITEM_OFFSET_STRIDE 4 |
Definition at line 83 of file multirangetypes.c.
#define MultirangeGetBoundariesPtr | ( | mr, | |
align | |||
) |
Definition at line 75 of file multirangetypes.c.
#define MultirangeGetFlagsPtr | ( | mr | ) |
Definition at line 73 of file multirangetypes.c.
#define MultirangeGetItemsPtr | ( | mr | ) |
Definition at line 71 of file multirangetypes.c.
typedef int(* multirange_bsearch_comparison) (TypeCacheEntry *typcache, RangeBound *lower, RangeBound *upper, void *key, bool *match) |
Definition at line 85 of file multirangetypes.c.
typedef struct MultirangeIOData MultirangeIOData |
enum MultirangeParseState |
Enumerator | |
---|---|
MULTIRANGE_BEFORE_RANGE | |
MULTIRANGE_IN_RANGE | |
MULTIRANGE_IN_RANGE_ESCAPED | |
MULTIRANGE_IN_RANGE_QUOTED | |
MULTIRANGE_IN_RANGE_QUOTED_ESCAPED | |
MULTIRANGE_AFTER_RANGE | |
MULTIRANGE_FINISHED |
Definition at line 56 of file multirangetypes.c.
Datum elem_contained_by_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1658 of file multirangetypes.c.
References multirange_contains_elem_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_DATUM, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, TypeCacheEntry::rngtype, and val.
|
static |
Definition at line 416 of file multirangetypes.c.
References elog, ereport, errcode(), errmsg(), ERROR, FunctionCallInfoBaseData::flinfo, fmgr_info_cxt(), FmgrInfo::fn_extra, FmgrInfo::fn_mcxt, format_type_be(), get_type_io_data(), if(), IOFunc_receive, lookup_type_cache(), MemoryContextAlloc(), OidIsValid, TypeCacheEntry::rngtype, typalign, MultirangeIOData::typcache, TypeCacheEntry::type_id, TYPECACHE_MULTIRANGE_INFO, MultirangeIOData::typioparam, and MultirangeIOData::typioproc.
Referenced by multirange_in(), multirange_out(), multirange_recv(), and multirange_send().
Datum hash_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2787 of file multirangetypes.c.
References DatumGetUInt32(), ereport, errcode(), errmsg(), ERROR, FmgrInfo::fn_oid, format_type_be(), FunctionCall1Coll(), TypeCacheEntry::hash_proc_finfo, hash_uint32(), i, lookup_type_cache(), lower(), multirange_get_bounds(), multirange_get_typcache(), MultirangeGetFlagsPtr, MultirangeTypeGetOid, OidIsValid, PG_FREE_IF_COPY, PG_GETARG_MULTIRANGE_P, PG_RETURN_UINT32, pg_rotate_left32(), RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, MultirangeType::rangeCount, TypeCacheEntry::rng_collation, TypeCacheEntry::rngelemtype, TypeCacheEntry::rngtype, TypeCacheEntry::type_id, TYPECACHE_HASH_PROC_FINFO, and upper().
Datum hash_multirange_extended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2858 of file multirangetypes.c.
References DatumGetInt64(), DatumGetUInt64(), ereport, errcode(), errmsg(), ERROR, FmgrInfo::fn_oid, format_type_be(), FunctionCall2Coll(), TypeCacheEntry::hash_extended_proc_finfo, hash_uint32_extended(), i, lookup_type_cache(), lower(), multirange_get_bounds(), multirange_get_typcache(), MultirangeGetFlagsPtr, MultirangeTypeGetOid, OidIsValid, PG_FREE_IF_COPY, PG_GETARG_DATUM, PG_GETARG_MULTIRANGE_P, PG_RETURN_UINT64, RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, MultirangeType::rangeCount, TypeCacheEntry::rng_collation, TypeCacheEntry::rngelemtype, TypeCacheEntry::rngtype, ROTATE_HIGH_AND_LOW_32BITS, TypeCacheEntry::type_id, TYPECACHE_HASH_EXTENDED_PROC_FINFO, and upper().
MultirangeType* make_empty_multirange | ( | Oid | mltrngtypoid, |
TypeCacheEntry * | rangetyp | ||
) |
Definition at line 848 of file multirangetypes.c.
References make_multirange().
Referenced by multirange_intersect().
MultirangeType* make_multirange | ( | Oid | mltrngtypoid, |
TypeCacheEntry * | rangetyp, | ||
int32 | range_count, | ||
RangeType ** | ranges | ||
) |
Definition at line 646 of file multirangetypes.c.
References multirange_canonicalize(), multirange_size_estimate(), MultirangeType::multirangetypid, palloc0(), MultirangeType::rangeCount, SET_VARSIZE, size, and write_multirange_data().
Referenced by make_empty_multirange(), multirange_constructor0(), multirange_constructor1(), multirange_constructor2(), multirange_in(), multirange_intersect_internal(), multirange_minus_internal(), multirange_recv(), multirange_union(), multirangesel(), and range_agg_finalfn().
Datum multirange_adjacent_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2534 of file multirangetypes.c.
References bounds_adjacent(), multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, MultirangeType::rangeCount, and TypeCacheEntry::rngtype.
Datum multirange_adjacent_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2519 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_adjacent_multirange_internal(), RangeIsEmpty, and TypeCacheEntry::rngtype.
Datum multirange_after_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2389 of file multirangetypes.c.
References multirange_before_multirange_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
Datum multirange_after_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2377 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_before_multirange_internal(), and TypeCacheEntry::rngtype.
Datum multirange_agg_transfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1412 of file multirangetypes.c.
References accumArrayResult(), AggCheckCallContext(), elog, ERROR, get_fn_expr_argtype(), i, initArrayResult(), make_empty_range(), multirange_deserialize(), multirange_get_typcache(), PG_ARGISNULL, PG_GETARG_MULTIRANGE_P, PG_GETARG_POINTER, PG_RETURN_POINTER, RangeTypePGetDatum(), TypeCacheEntry::rngtype, TypeCacheEntry::type_id, and type_is_multirange().
Datum multirange_before_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2352 of file multirangetypes.c.
References multirange_before_multirange_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
bool multirange_before_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | mr1, | ||
const MultirangeType * | mr2 | ||
) |
Definition at line 2424 of file multirangetypes.c.
References multirange_get_bounds(), MultirangeIsEmpty, range_cmp_bounds(), and MultirangeType::rangeCount.
Referenced by multirange_after_multirange(), and multirange_before_multirange().
Datum multirange_before_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2340 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_after_multirange_internal(), and TypeCacheEntry::rngtype.
|
static |
Definition at line 898 of file multirangetypes.c.
References idx(), sort-test::key, lower(), multirange_get_bounds(), MultirangeType::rangeCount, and upper().
Referenced by multirange_contains_elem_internal(), multirange_contains_range_internal(), and range_overlaps_multirange_internal().
|
static |
Definition at line 477 of file multirangetypes.c.
References i, qsort_arg(), range_adjacent_internal(), range_before_internal(), range_compare(), range_union_internal(), and RangeIsEmpty.
Referenced by make_multirange().
Datum multirange_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2575 of file multirangetypes.c.
References cmp(), elog, ERROR, i, Max, multirange_get_bounds(), multirange_get_typcache(), MultirangeTypeGetOid, PG_FREE_IF_COPY, PG_GETARG_MULTIRANGE_P, PG_RETURN_INT32, range_cmp_bounds(), MultirangeType::rangeCount, and TypeCacheEntry::rngtype.
Referenced by multirange_ge(), multirange_gt(), multirange_le(), and multirange_lt().
Datum multirange_constructor0 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1059 of file multirangetypes.c.
References elog, ERROR, get_fn_expr_rettype(), make_multirange(), multirange_get_typcache(), PG_NARGS, PG_RETURN_MULTIRANGE_P, and TypeCacheEntry::rngtype.
Datum multirange_constructor1 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1023 of file multirangetypes.c.
References elog, ERROR, get_fn_expr_rettype(), make_multirange(), multirange_get_typcache(), PG_ARGISNULL, PG_GETARG_RANGE_P, PG_RETURN_MULTIRANGE_P, range(), RangeTypeGetOid, TypeCacheEntry::rngtype, and TypeCacheEntry::type_id.
Datum multirange_constructor2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 941 of file multirangetypes.c.
References ARR_ELEMTYPE, ARR_NDIM, DatumGetRangeTypeP(), deconstruct_array(), elog, ereport, errcode(), errmsg(), ERROR, get_fn_expr_rettype(), i, make_multirange(), multirange_get_typcache(), palloc0(), PG_ARGISNULL, PG_GETARG_ARRAYTYPE_P, PG_NARGS, PG_RETURN_MULTIRANGE_P, TypeCacheEntry::rngtype, TypeCacheEntry::typalign, TypeCacheEntry::typbyval, TypeCacheEntry::type_id, and TypeCacheEntry::typlen.
Datum multirange_contained_by_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2251 of file multirangetypes.c.
References multirange_contains_multirange_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
Datum multirange_contained_by_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1758 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_contains_multirange_internal(), and TypeCacheEntry::rngtype.
Datum multirange_contains_elem | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1645 of file multirangetypes.c.
References multirange_contains_elem_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_DATUM, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, TypeCacheEntry::rngtype, and val.
bool multirange_contains_elem_internal | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | mr, | ||
Datum | val | ||
) |
Definition at line 1707 of file multirangetypes.c.
References multirange_bsearch_match(), multirange_elem_bsearch_comparison(), MultirangeIsEmpty, and val.
Referenced by elem_contained_by_multirange(), and multirange_contains_elem().
Datum multirange_contains_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2238 of file multirangetypes.c.
References multirange_contains_multirange_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
bool multirange_contains_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | mr1, | ||
const MultirangeType * | mr2 | ||
) |
Definition at line 2266 of file multirangetypes.c.
References multirange_get_bounds(), range_bounds_contains(), range_cmp_bounds(), and MultirangeType::rangeCount.
Referenced by multirange_contained_by_multirange(), and multirange_contains_multirange().
Datum multirange_contains_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1721 of file multirangetypes.c.
References multirange_contains_range_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
bool multirange_contains_range_internal | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | mr, | ||
const RangeType * | r | ||
) |
Definition at line 1801 of file multirangetypes.c.
References Assert, multirange_bsearch_match(), multirange_range_contains_bsearch_comparison(), MultirangeIsEmpty, range_deserialize(), and RangeIsEmpty.
Referenced by multirange_contains_range(), range_contained_by_multirange(), and range_gist_consistent_leaf_multirange().
void multirange_deserialize | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | multirange, | ||
int32 * | range_count, | ||
RangeType *** | ranges | ||
) |
Definition at line 826 of file multirangetypes.c.
References i, multirange_get_range(), palloc(), and MultirangeType::rangeCount.
Referenced by multirange_agg_transfn(), multirange_intersect(), multirange_intersect_agg_transfn(), multirange_minus(), multirange_out(), multirange_send(), and multirange_union().
|
static |
Definition at line 1674 of file multirangetypes.c.
References cmp(), DatumGetInt32(), FunctionCall2Coll(), sort-test::key, lower(), TypeCacheEntry::rng_cmp_proc_finfo, TypeCacheEntry::rng_collation, upper(), and val.
Referenced by multirange_contains_elem_internal().
Datum multirange_empty | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1556 of file multirangetypes.c.
References MultirangeIsEmpty, PG_GETARG_MULTIRANGE_P, and PG_RETURN_BOOL.
Datum multirange_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1901 of file multirangetypes.c.
References multirange_eq_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
bool multirange_eq_internal | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | mr1, | ||
const MultirangeType * | mr2 | ||
) |
Definition at line 1864 of file multirangetypes.c.
References elog, ERROR, i, multirange_get_bounds(), MultirangeTypeGetOid, range_cmp_bounds(), and MultirangeType::rangeCount.
Referenced by multirange_eq(), and multirange_ne_internal().
Datum multirange_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2656 of file multirangetypes.c.
References cmp(), multirange_cmp(), and PG_RETURN_BOOL.
void multirange_get_bounds | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | multirange, | ||
uint32 | i, | ||
RangeBound * | lower, | ||
RangeBound * | upper | ||
) |
Definition at line 744 of file multirangetypes.c.
References Assert, att_addlength_pointer, att_align_pointer, fetch_att(), i, lower(), multirange_get_bounds_offset(), MultirangeGetBoundariesPtr, MultirangeGetFlagsPtr, RANGE_EMPTY, RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RANGE_LB_INC, RANGE_LB_INF, RANGE_UB_INC, RANGE_UB_INF, TypeCacheEntry::rngelemtype, typalign, TypeCacheEntry::typalign, TypeCacheEntry::typbyval, TypeCacheEntry::typlen, and upper().
Referenced by calc_hist_selectivity(), compute_range_stats(), hash_multirange(), hash_multirange_extended(), multirange_adjacent_multirange(), multirange_before_multirange_internal(), multirange_bsearch_match(), multirange_cmp(), multirange_contains_multirange_internal(), multirange_eq_internal(), multirange_get_union_range(), multirange_lower(), multirange_lower_inc(), multirange_lower_inf(), multirange_overlaps_multirange_internal(), multirange_overleft_multirange(), multirange_overleft_range(), multirange_overright_multirange(), multirange_overright_range(), multirange_union_range_equal(), multirange_upper(), multirange_upper_inc(), multirange_upper_inf(), range_adjacent_multirange_internal(), range_after_multirange_internal(), range_before_multirange_internal(), range_contains_multirange_internal(), range_merge_from_multirange(), range_overleft_multirange_internal(), and range_overright_multirange_internal().
|
static |
Definition at line 673 of file multirangetypes.c.
References i, items, MULTIRANGE_ITEM_GET_OFFLEN, MULTIRANGE_ITEM_HAS_OFF, and MultirangeGetItemsPtr.
Referenced by multirange_get_bounds(), and multirange_get_range().
RangeType* multirange_get_range | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | multirange, | ||
int | i | ||
) |
Definition at line 695 of file multirangetypes.c.
References Assert, att_addlength_pointer, att_align_pointer, i, len, multirange_get_bounds_offset(), MultirangeGetBoundariesPtr, MultirangeGetFlagsPtr, palloc0(), range(), RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, TypeCacheEntry::rngelemtype, SET_VARSIZE, typalign, TypeCacheEntry::typalign, TypeCacheEntry::type_id, and TypeCacheEntry::typlen.
Referenced by multirange_deserialize(), multirange_unnest(), and range_merge_from_multirange().
TypeCacheEntry* multirange_get_typcache | ( | FunctionCallInfo | fcinfo, |
Oid | mltrngtypid | ||
) |
Definition at line 548 of file multirangetypes.c.
References elog, ERROR, FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_extra, if(), lookup_type_cache(), TypeCacheEntry::rngtype, TypeCacheEntry::type_id, and TYPECACHE_MULTIRANGE_INFO.
Referenced by elem_contained_by_multirange(), hash_multirange(), hash_multirange_extended(), multirange_adjacent_multirange(), multirange_adjacent_range(), multirange_after_multirange(), multirange_after_range(), multirange_agg_transfn(), multirange_before_multirange(), multirange_before_range(), multirange_cmp(), multirange_constructor0(), multirange_constructor1(), multirange_constructor2(), multirange_contained_by_multirange(), multirange_contained_by_range(), multirange_contains_elem(), multirange_contains_multirange(), multirange_contains_range(), multirange_eq(), multirange_gist_compress(), multirange_intersect(), multirange_intersect_agg_transfn(), multirange_lower(), multirange_lower_inc(), multirange_lower_inf(), multirange_minus(), multirange_ne(), multirange_overlaps_multirange(), multirange_overlaps_range(), multirange_overleft_multirange(), multirange_overleft_range(), multirange_overright_multirange(), multirange_overright_range(), multirange_typanalyze(), multirange_union(), multirange_upper(), multirange_upper_inc(), multirange_upper_inf(), multirangesel(), range_adjacent_multirange(), range_after_multirange(), range_agg_finalfn(), range_before_multirange(), range_contained_by_multirange(), range_contains_multirange(), range_merge_from_multirange(), range_overlaps_multirange(), range_overleft_multirange(), and range_overright_multirange().
RangeType* multirange_get_union_range | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | mr | ||
) |
Definition at line 802 of file multirangetypes.c.
References lower(), make_empty_range(), make_range(), multirange_get_bounds(), MultirangeIsEmpty, MultirangeType::rangeCount, and upper().
Referenced by multirange_gist_compress().
Datum multirange_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2664 of file multirangetypes.c.
References cmp(), multirange_cmp(), and PG_RETURN_BOOL.
Datum multirange_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 117 of file multirangetypes.c.
References DatumGetRangeTypeP(), elog, ereturn, errcode(), errdetail(), errmsg(), ERROR, get_multirange_io_data(), InputFunctionCallSafe(), IOFunc_input, make_multirange(), MULTIRANGE_AFTER_RANGE, MULTIRANGE_BEFORE_RANGE, MULTIRANGE_FINISHED, MULTIRANGE_IN_RANGE, MULTIRANGE_IN_RANGE_ESCAPED, MULTIRANGE_IN_RANGE_QUOTED, MULTIRANGE_IN_RANGE_QUOTED_ESCAPED, palloc(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_GETARG_OID, PG_RETURN_MULTIRANGE_P, PG_RETURN_NULL, pg_strncasecmp(), pnstrdup(), range(), RANGE_EMPTY_LITERAL, RangeIsEmpty, repalloc(), TypeCacheEntry::rngtype, MultirangeIOData::typcache, MultirangeIOData::typioparam, and MultirangeIOData::typioproc.
Datum multirange_intersect | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1230 of file multirangetypes.c.
References make_empty_multirange(), multirange_deserialize(), multirange_get_typcache(), multirange_intersect_internal(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_MULTIRANGE_P, and TypeCacheEntry::rngtype.
Datum multirange_intersect_agg_transfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1465 of file multirangetypes.c.
References AggCheckCallContext(), elog, ERROR, get_fn_expr_argtype(), multirange_deserialize(), multirange_get_typcache(), multirange_intersect_internal(), PG_GETARG_MULTIRANGE_P, PG_RETURN_MULTIRANGE_P, TypeCacheEntry::rngtype, and type_is_multirange().
MultirangeType* multirange_intersect_internal | ( | Oid | mltrngtypoid, |
TypeCacheEntry * | rangetyp, | ||
int32 | range_count1, | ||
RangeType ** | ranges1, | ||
int32 | range_count2, | ||
RangeType ** | ranges2 | ||
) |
Definition at line 1260 of file multirangetypes.c.
References make_multirange(), palloc0(), range_before_internal(), range_intersect_internal(), range_overlaps_internal(), and range_overleft_internal().
Referenced by multirange_intersect(), and multirange_intersect_agg_transfn().
Datum multirange_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2648 of file multirangetypes.c.
References cmp(), multirange_cmp(), and PG_RETURN_BOOL.
Datum multirange_lower | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1507 of file multirangetypes.c.
References lower(), multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_DATUM, PG_RETURN_NULL, TypeCacheEntry::rngtype, and upper().
Datum multirange_lower_inc | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1565 of file multirangetypes.c.
References lower(), multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, TypeCacheEntry::rngtype, and upper().
Datum multirange_lower_inf | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1603 of file multirangetypes.c.
References lower(), multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, TypeCacheEntry::rngtype, and upper().
Datum multirange_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2640 of file multirangetypes.c.
References cmp(), multirange_cmp(), and PG_RETURN_BOOL.
Datum multirange_minus | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1114 of file multirangetypes.c.
References multirange_deserialize(), multirange_get_typcache(), multirange_minus_internal(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_MULTIRANGE_P, and TypeCacheEntry::rngtype.
MultirangeType* multirange_minus_internal | ( | Oid | mltrngtypoid, |
TypeCacheEntry * | rangetyp, | ||
int32 | range_count1, | ||
RangeType ** | ranges1, | ||
int32 | range_count2, | ||
RangeType ** | ranges2 | ||
) |
Definition at line 1144 of file multirangetypes.c.
References make_multirange(), palloc0(), range_before_internal(), range_minus_internal(), range_overlaps_internal(), range_split_internal(), and RangeIsEmpty.
Referenced by multirange_minus().
Datum multirange_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1923 of file multirangetypes.c.
References multirange_get_typcache(), multirange_ne_internal(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
bool multirange_ne_internal | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | mr1, | ||
const MultirangeType * | mr2 | ||
) |
Definition at line 1914 of file multirangetypes.c.
References multirange_eq_internal().
Referenced by multirange_ne().
Datum multirange_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 299 of file multirangetypes.c.
References appendStringInfoChar(), appendStringInfoString(), buf, get_multirange_io_data(), i, initStringInfo(), IOFunc_output, multirange_deserialize(), MultirangeTypeGetOid, OutputFunctionCall(), PG_GETARG_MULTIRANGE_P, PG_RETURN_CSTRING, range(), RangeTypePGetDatum(), TypeCacheEntry::rngtype, MultirangeIOData::typcache, and MultirangeIOData::typioproc.
Referenced by anycompatiblemultirange_out(), and anymultirange_out().
Datum multirange_overlaps_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1960 of file multirangetypes.c.
References multirange_get_typcache(), multirange_overlaps_multirange_internal(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
bool multirange_overlaps_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const MultirangeType * | mr1, | ||
const MultirangeType * | mr2 | ||
) |
Definition at line 2015 of file multirangetypes.c.
References multirange_get_bounds(), MultirangeIsEmpty, range_bounds_overlaps(), range_cmp_bounds(), and MultirangeType::rangeCount.
Referenced by multirange_overlaps_multirange().
Datum multirange_overlaps_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1948 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_overlaps_multirange_internal(), and TypeCacheEntry::rngtype.
Datum multirange_overleft_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2133 of file multirangetypes.c.
References multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, range_cmp_bounds(), MultirangeType::rangeCount, and TypeCacheEntry::rngtype.
Datum multirange_overleft_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2108 of file multirangetypes.c.
References Assert, multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_cmp_bounds(), range_deserialize(), MultirangeType::rangeCount, RangeIsEmpty, and TypeCacheEntry::rngtype.
Datum multirange_overright_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2215 of file multirangetypes.c.
References multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, range_cmp_bounds(), and TypeCacheEntry::rngtype.
Datum multirange_overright_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2191 of file multirangetypes.c.
References Assert, multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_cmp_bounds(), range_deserialize(), RangeIsEmpty, and TypeCacheEntry::rngtype.
|
static |
Definition at line 1774 of file multirangetypes.c.
References sort-test::key, lower(), range_bounds_contains(), range_cmp_bounds(), and upper().
Referenced by multirange_contains_range_internal().
|
static |
Definition at line 1976 of file multirangetypes.c.
References sort-test::key, lower(), range_cmp_bounds(), and upper().
Referenced by range_overlaps_multirange_internal().
Datum multirange_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 337 of file multirangetypes.c.
References appendBinaryStringInfo(), buf, StringInfoData::data, DatumGetRangeTypeP(), get_multirange_io_data(), i, initStringInfo(), IOFunc_receive, make_multirange(), palloc(), pfree(), PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_MULTIRANGE_P, pq_getmsgbytes(), pq_getmsgend(), pq_getmsgint(), ReceiveFunctionCall(), resetStringInfo(), TypeCacheEntry::rngtype, tmpbuf, MultirangeIOData::typcache, MultirangeIOData::typioparam, and MultirangeIOData::typioproc.
Datum multirange_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 377 of file multirangetypes.c.
References buf, get_multirange_io_data(), i, IOFunc_send, makeStringInfo(), multirange_deserialize(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BYTEA_P, PointerGetDatum(), pq_begintypsend(), pq_endtypsend(), pq_sendbytes(), pq_sendint32(), range(), MultirangeType::rangeCount, RangeTypePGetDatum(), TypeCacheEntry::rngtype, SendFunctionCall(), MultirangeIOData::typcache, MultirangeIOData::typioproc, VARDATA, VARHDRSZ, and VARSIZE.
|
static |
Definition at line 569 of file multirangetypes.c.
References att_align_nominal, i, Max, TypeCacheEntry::rngelemtype, size, TypeCacheEntry::typalign, and VARSIZE.
Referenced by make_multirange().
Datum multirange_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1082 of file multirangetypes.c.
References make_multirange(), multirange_deserialize(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, palloc0(), PG_GETARG_MULTIRANGE_P, PG_RETURN_MULTIRANGE_P, TypeCacheEntry::rngtype, and TypeCacheEntry::type_id.
Datum multirange_unnest | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2713 of file multirangetypes.c.
References lookup_type_cache(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, multirange_get_range(), MultirangeTypeGetOid, palloc(), PG_GETARG_MULTIRANGE_P, range(), RangeTypePGetDatum(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, TYPECACHE_MULTIRANGE_INFO, and FuncCallContext::user_fctx.
Datum multirange_upper | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1530 of file multirangetypes.c.
References lower(), multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_DATUM, PG_RETURN_NULL, MultirangeType::rangeCount, TypeCacheEntry::rngtype, and upper().
Datum multirange_upper_inc | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1584 of file multirangetypes.c.
References lower(), multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, MultirangeType::rangeCount, TypeCacheEntry::rngtype, and upper().
Datum multirange_upper_inf | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1622 of file multirangetypes.c.
References lower(), multirange_get_bounds(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_BOOL, MultirangeType::rangeCount, TypeCacheEntry::rngtype, and upper().
Datum range_adjacent_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2507 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_adjacent_multirange_internal(), and TypeCacheEntry::rngtype.
bool range_adjacent_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const RangeType * | r, | ||
const MultirangeType * | mr | ||
) |
Definition at line 2471 of file multirangetypes.c.
References Assert, bounds_adjacent(), multirange_get_bounds(), MultirangeIsEmpty, range_deserialize(), MultirangeType::rangeCount, and RangeIsEmpty.
Referenced by multirange_adjacent_range(), range_adjacent_multirange(), range_gist_consistent_int_multirange(), and range_gist_consistent_leaf_multirange().
Datum range_after_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2365 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_after_multirange_internal(), and TypeCacheEntry::rngtype.
bool range_after_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const RangeType * | r, | ||
const MultirangeType * | mr | ||
) |
Definition at line 2446 of file multirangetypes.c.
References Assert, multirange_get_bounds(), MultirangeIsEmpty, range_cmp_bounds(), range_deserialize(), MultirangeType::rangeCount, and RangeIsEmpty.
Referenced by multirange_before_range(), range_after_multirange(), range_gist_consistent_int_multirange(), and range_gist_consistent_leaf_multirange().
Datum range_agg_finalfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1372 of file multirangetypes.c.
References AggCheckCallContext(), DatumGetRangeTypeP(), elog, ERROR, get_fn_expr_rettype(), i, make_multirange(), multirange_get_typcache(), palloc0(), PG_ARGISNULL, PG_GETARG_POINTER, PG_RETURN_MULTIRANGE_P, PG_RETURN_NULL, and TypeCacheEntry::rngtype.
Datum range_agg_transfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1340 of file multirangetypes.c.
References accumArrayResult(), AggCheckCallContext(), elog, ERROR, get_fn_expr_argtype(), initArrayResult(), PG_ARGISNULL, PG_GETARG_DATUM, PG_GETARG_POINTER, PG_RETURN_POINTER, and type_is_range().
Datum range_before_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2328 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_before_multirange_internal(), and TypeCacheEntry::rngtype.
bool range_before_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const RangeType * | r, | ||
const MultirangeType * | mr | ||
) |
Definition at line 2402 of file multirangetypes.c.
References Assert, multirange_get_bounds(), MultirangeIsEmpty, range_cmp_bounds(), range_deserialize(), and RangeIsEmpty.
Referenced by multirange_after_range(), range_before_multirange(), range_gist_consistent_int_multirange(), and range_gist_consistent_leaf_multirange().
|
static |
Definition at line 878 of file multirangetypes.c.
References range_cmp_bounds().
Referenced by multirange_contains_multirange_internal(), multirange_range_contains_bsearch_comparison(), and range_contains_multirange_internal().
|
static |
Definition at line 858 of file multirangetypes.c.
References range_cmp_bounds().
Referenced by multirange_overlaps_multirange_internal().
Datum range_contained_by_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1746 of file multirangetypes.c.
References multirange_contains_range_internal(), multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, and TypeCacheEntry::rngtype.
Datum range_contains_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1733 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_contains_multirange_internal(), and TypeCacheEntry::rngtype.
bool range_contains_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const RangeType * | r, | ||
const MultirangeType * | mr | ||
) |
Definition at line 1829 of file multirangetypes.c.
References Assert, multirange_get_bounds(), MultirangeIsEmpty, range_bounds_contains(), range_deserialize(), MultirangeType::rangeCount, and RangeIsEmpty.
Referenced by multirange_contained_by_range(), range_contains_multirange(), range_gist_consistent_int_multirange(), and range_gist_consistent_leaf_multirange().
Datum range_merge_from_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2675 of file multirangetypes.c.
References make_empty_range(), make_range(), multirange_get_bounds(), multirange_get_range(), multirange_get_typcache(), MultirangeIsEmpty, MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_RETURN_RANGE_P, MultirangeType::rangeCount, and TypeCacheEntry::rngtype.
Datum range_overlaps_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1936 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_overlaps_multirange_internal(), and TypeCacheEntry::rngtype.
bool range_overlaps_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const RangeType * | r, | ||
const MultirangeType * | mr | ||
) |
Definition at line 1993 of file multirangetypes.c.
References Assert, multirange_bsearch_match(), multirange_range_overlaps_bsearch_comparison(), MultirangeIsEmpty, range_deserialize(), and RangeIsEmpty.
Referenced by multirange_overlaps_range(), range_gist_consistent_int_multirange(), range_gist_consistent_leaf_multirange(), and range_overlaps_multirange().
Datum range_overleft_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2096 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_overleft_multirange_internal(), and TypeCacheEntry::rngtype.
bool range_overleft_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const RangeType * | r, | ||
const MultirangeType * | mr | ||
) |
Definition at line 2073 of file multirangetypes.c.
References Assert, multirange_get_bounds(), MultirangeIsEmpty, PG_RETURN_BOOL, range_cmp_bounds(), range_deserialize(), MultirangeType::rangeCount, and RangeIsEmpty.
Referenced by range_gist_consistent_int_multirange(), range_gist_consistent_leaf_multirange(), and range_overleft_multirange().
Datum range_overright_multirange | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2179 of file multirangetypes.c.
References multirange_get_typcache(), MultirangeTypeGetOid, PG_GETARG_MULTIRANGE_P, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_overright_multirange_internal(), and TypeCacheEntry::rngtype.
bool range_overright_multirange_internal | ( | TypeCacheEntry * | rangetyp, |
const RangeType * | r, | ||
const MultirangeType * | mr | ||
) |
Definition at line 2158 of file multirangetypes.c.
References Assert, multirange_get_bounds(), MultirangeIsEmpty, PG_RETURN_BOOL, range_cmp_bounds(), range_deserialize(), and RangeIsEmpty.
Referenced by range_gist_consistent_int_multirange(), range_gist_consistent_leaf_multirange(), and range_overright_multirange().
|
static |
Definition at line 596 of file multirangetypes.c.
References att_align_nominal, i, items, len, MULTIRANGE_ITEM_OFF_BIT, MULTIRANGE_ITEM_OFFSET_STRIDE, MultirangeGetBoundariesPtr, MultirangeGetFlagsPtr, MultirangeGetItemsPtr, TypeCacheEntry::rngelemtype, TypeCacheEntry::typalign, and VARSIZE.
Referenced by make_multirange().