PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "common/hashfn.h"
#include "libpq/pqformat.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/miscnodes.h"
#include "nodes/supportnodes.h"
#include "optimizer/clauses.h"
#include "optimizer/cost.h"
#include "optimizer/optimizer.h"
#include "utils/builtins.h"
#include "utils/date.h"
#include "utils/lsyscache.h"
#include "utils/rangetypes.h"
#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
struct | RangeIOData |
Macros | |
#define | TYPE_IS_PACKABLE(typlen, typstorage) ((typlen) == -1 && (typstorage) != TYPSTORAGE_PLAIN) |
Typedefs | |
typedef struct RangeIOData | RangeIOData |
#define TYPE_IS_PACKABLE | ( | typlen, | |
typstorage | |||
) | ((typlen) == -1 && (typstorage) != TYPSTORAGE_PLAIN) |
Definition at line 2675 of file rangetypes.c.
typedef struct RangeIOData RangeIOData |
bool bounds_adjacent | ( | TypeCacheEntry * | typcache, |
RangeBound | boundA, | ||
RangeBound | boundB | ||
) |
Definition at line 757 of file rangetypes.c.
References Assert, cmp(), FmgrInfo::fn_oid, RangeBound::inclusive, RangeBound::lower, make_range(), OidIsValid, range_cmp_bound_values(), RangeIsEmpty, and TypeCacheEntry::rng_canonical_finfo.
Referenced by adjacent_cmp_bounds(), multirange_adjacent_multirange(), range_adjacent_internal(), and range_adjacent_multirange_internal().
|
static |
Definition at line 2908 of file rangetypes.c.
References BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, get_opfamily_member(), InvalidOid, make_opclause(), makeConst(), OidIsValid, TypeCacheEntry::typbyval, TypeCacheEntry::typcollation, TypeCacheEntry::type_id, TypeCacheEntry::typlen, and val.
Referenced by find_simplified_clause().
Datum daterange_canonical | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1558 of file rangetypes.c.
References DATE_NOT_FINITE, DateADTGetDatum(), DatumGetDateADT(), ereturn, errcode(), errmsg(), IS_VALID_DATE, lower(), PG_GETARG_RANGE_P, PG_RETURN_RANGE_P, range_deserialize(), range_get_typcache(), range_serialize(), RangeTypeGetOid, unlikely, and upper().
Datum daterange_subdiff | ( | PG_FUNCTION_ARGS | ) |
|
static |
Definition at line 2683 of file rangetypes.c.
References att_addlength_datum, att_align_datum, DatumGetPointer(), typalign, TYPE_IS_PACKABLE, val, VARATT_CAN_MAKE_SHORT, and VARATT_CONVERTED_SHORT_SIZE.
Referenced by range_serialize().
|
static |
Definition at line 2709 of file rangetypes.c.
References Assert, att_align_nominal, DatumGetCString(), DatumGetPointer(), elog, ERROR, SET_VARSIZE_SHORT, store_att_byval(), typalign, TYPE_IS_PACKABLE, val, VARATT_CAN_MAKE_SHORT, VARATT_CONVERTED_SHORT_SIZE, VARATT_IS_EXTERNAL, VARATT_IS_SHORT, VARDATA, VARSIZE, and VARSIZE_SHORT.
Referenced by range_serialize().
Datum elem_contained_by_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 557 of file rangetypes.c.
References PG_GETARG_DATUM, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_contains_elem_internal(), range_get_typcache(), RangeTypeGetOid, and val.
Datum elem_contained_by_range_support | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2187 of file rangetypes.c.
References FuncExpr::args, Assert, SupportRequestSimplify::fcall, find_simplified_clause(), IsA, linitial, list_length(), lsecond, PG_GETARG_POINTER, PG_RETURN_POINTER, and SupportRequestSimplify::root.
|
static |
Definition at line 2786 of file rangetypes.c.
References Assert, build_bound_expr(), contain_subplans(), contain_volatile_functions(), copyObject, cost_qual_eval_node(), cpu_operator_cost, DatumGetRangeTypeP(), elog, ERROR, IsA, list_make2, lookup_type_cache(), lower(), make_andclause(), makeBoolConst(), QualCost::per_tuple, range(), range_deserialize(), RangeTypeGetOid, TypeCacheEntry::rng_collation, TypeCacheEntry::rng_opfamily, TypeCacheEntry::rngelemtype, root, QualCost::startup, TYPECACHE_RANGE_INFO, and upper().
Referenced by elem_contained_by_range_support(), and range_contains_elem_support().
|
static |
Definition at line 317 of file rangetypes.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::rngelemtype, typalign, RangeIOData::typcache, TypeCacheEntry::type_id, TYPECACHE_RANGE_INFO, RangeIOData::typioparam, and RangeIOData::typioproc.
Referenced by range_in(), range_out(), range_recv(), and range_send().
Datum hash_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1330 of file rangetypes.c.
References check_stack_depth(), DatumGetUInt32(), ereport, errcode(), errmsg(), ERROR, FmgrInfo::fn_oid, format_type_be(), FunctionCall1Coll(), TypeCacheEntry::hash_proc_finfo, hash_uint32(), lookup_type_cache(), lower(), OidIsValid, PG_GETARG_RANGE_P, PG_RETURN_INT32, pg_rotate_left32(), range_deserialize(), range_get_flags(), range_get_typcache(), RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RangeTypeGetOid, TypeCacheEntry::rng_collation, TypeCacheEntry::rngelemtype, TypeCacheEntry::type_id, TYPECACHE_HASH_PROC_FINFO, and upper().
Datum hash_range_extended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1396 of file rangetypes.c.
References check_stack_depth(), DatumGetInt64(), DatumGetUInt64(), ereport, errcode(), errmsg(), ERROR, FmgrInfo::fn_oid, format_type_be(), FunctionCall2Coll(), TypeCacheEntry::hash_extended_proc_finfo, hash_uint32_extended(), lookup_type_cache(), lower(), OidIsValid, PG_GETARG_DATUM, PG_GETARG_RANGE_P, PG_RETURN_UINT64, range_deserialize(), range_get_flags(), range_get_typcache(), RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RangeTypeGetOid, TypeCacheEntry::rng_collation, TypeCacheEntry::rngelemtype, ROTATE_HIGH_AND_LOW_32BITS, TypeCacheEntry::type_id, TYPECACHE_HASH_EXTENDED_PROC_FINFO, and upper().
Datum int4range_canonical | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1464 of file rangetypes.c.
References DatumGetInt32(), ereturn, errcode(), errmsg(), Int32GetDatum(), lower(), PG_GETARG_RANGE_P, PG_INT32_MAX, PG_RETURN_RANGE_P, range_deserialize(), range_get_typcache(), range_serialize(), RangeTypeGetOid, unlikely, and upper().
Datum int4range_subdiff | ( | PG_FUNCTION_ARGS | ) |
Datum int8range_canonical | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1511 of file rangetypes.c.
References DatumGetInt64(), ereturn, errcode(), errmsg(), Int64GetDatum(), lower(), PG_GETARG_RANGE_P, PG_INT64_MAX, PG_RETURN_RANGE_P, range_deserialize(), range_get_typcache(), range_serialize(), RangeTypeGetOid, unlikely, and upper().
Datum int8range_subdiff | ( | PG_FUNCTION_ARGS | ) |
RangeType* make_empty_range | ( | TypeCacheEntry * | typcache | ) |
Definition at line 2165 of file rangetypes.c.
References lower(), make_range(), and upper().
Referenced by multirange_agg_transfn(), multirange_get_union_range(), range_intersect_internal(), range_merge_from_multirange(), and range_minus_internal().
RangeType* make_range | ( | TypeCacheEntry * | typcache, |
RangeBound * | lower, | ||
RangeBound * | upper, | ||
bool | empty, | ||
struct Node * | escontext | ||
) |
Definition at line 1952 of file rangetypes.c.
References DatumGetRangeTypeP(), elog, ERROR, FmgrInfo::fn_oid, FunctionCallInvoke, InitFunctionCallInfoData, InvalidOid, LOCAL_FCINFO, lower(), OidIsValid, range(), range_serialize(), RangeIsEmpty, RangeTypePGetDatum(), TypeCacheEntry::rng_canonical_finfo, SOFT_ERROR_OCCURRED, and upper().
Referenced by bounds_adjacent(), make_empty_range(), multirange_get_union_range(), range_constructor2(), range_constructor3(), range_in(), range_intersect_internal(), range_merge_from_multirange(), range_minus_internal(), range_recv(), range_split_internal(), range_super_union(), and range_union_internal().
Datum numrange_subdiff | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1639 of file rangetypes.c.
References DatumGetFloat8(), DirectFunctionCall1, DirectFunctionCall2, numeric_float8(), numeric_sub(), PG_GETARG_DATUM, and PG_RETURN_FLOAT8.
Datum range_adjacent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 828 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_adjacent_internal(), range_get_typcache(), and RangeTypeGetOid.
bool range_adjacent_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 798 of file rangetypes.c.
References bounds_adjacent(), elog, ERROR, range_deserialize(), and RangeTypeGetOid.
Referenced by multirange_canonicalize(), range_adjacent(), range_gist_consistent_int_range(), range_gist_consistent_leaf_range(), range_union_internal(), and spg_range_quad_leaf_consistent().
Datum range_after | ( | PG_FUNCTION_ARGS | ) |
Definition at line 727 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_after_internal(), range_get_typcache(), and RangeTypeGetOid.
bool range_after_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 702 of file rangetypes.c.
References elog, ERROR, range_cmp_bounds(), range_deserialize(), and RangeTypeGetOid.
Referenced by range_after(), range_gist_consistent_int_range(), range_gist_consistent_leaf_range(), and spg_range_quad_leaf_consistent().
Datum range_before | ( | PG_FUNCTION_ARGS | ) |
Definition at line 689 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_before_internal(), range_get_typcache(), and RangeTypeGetOid.
bool range_before_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 664 of file rangetypes.c.
References elog, ERROR, range_cmp_bounds(), range_deserialize(), and RangeTypeGetOid.
Referenced by multirange_canonicalize(), multirange_intersect_internal(), multirange_minus_internal(), range_before(), range_gist_consistent_int_range(), range_gist_consistent_leaf_range(), and spg_range_quad_leaf_consistent().
|
static |
Definition at line 2537 of file rangetypes.c.
References appendStringInfoChar(), buf, initStringInfo(), and value.
Referenced by range_deparse().
Datum range_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1249 of file rangetypes.c.
References check_stack_depth(), cmp(), elog, ERROR, PG_FREE_IF_COPY, PG_GETARG_RANGE_P, PG_RETURN_INT32, range_cmp_bounds(), range_deserialize(), range_get_typcache(), and RangeTypeGetOid.
Referenced by range_ge(), range_gt(), range_le(), and range_lt().
int range_cmp_bound_values | ( | TypeCacheEntry * | typcache, |
const RangeBound * | b1, | ||
const RangeBound * | b2 | ||
) |
Definition at line 2090 of file rangetypes.c.
References DatumGetInt32(), FunctionCall2Coll(), RangeBound::infinite, RangeBound::lower, TypeCacheEntry::rng_cmp_proc_finfo, TypeCacheEntry::rng_collation, and RangeBound::val.
Referenced by bounds_adjacent(), and range_serialize().
int range_cmp_bounds | ( | TypeCacheEntry * | typcache, |
const RangeBound * | b1, | ||
const RangeBound * | b2 | ||
) |
Definition at line 2016 of file rangetypes.c.
References DatumGetInt32(), FunctionCall2Coll(), RangeBound::inclusive, RangeBound::infinite, RangeBound::lower, TypeCacheEntry::rng_cmp_proc_finfo, TypeCacheEntry::rng_collation, and RangeBound::val.
Referenced by adjacent_cmp_bounds(), adjacent_inner_consistent(), bound_cmp(), calc_hist_selectivity_contained(), getQuadrant(), interval_cmp_lower(), interval_cmp_upper(), multirange_before_multirange_internal(), multirange_cmp(), multirange_contains_multirange_internal(), multirange_eq_internal(), multirange_overlaps_multirange_internal(), multirange_overleft_multirange(), multirange_overleft_range(), multirange_overright_multirange(), multirange_overright_range(), multirange_range_contains_bsearch_comparison(), multirange_range_overlaps_bsearch_comparison(), multirange_union_range_equal(), range_after_internal(), range_after_multirange_internal(), range_before_internal(), range_before_multirange_internal(), range_bound_qsort_cmp(), range_bounds_contains(), range_bounds_overlaps(), range_cmp(), range_compare(), range_contains_internal(), range_eq_internal(), range_gist_double_sorting_split(), range_gist_penalty(), range_intersect_internal(), range_minus_internal(), range_overlaps_internal(), range_overleft_internal(), range_overleft_multirange_internal(), range_overright_internal(), range_overright_multirange_internal(), range_split_internal(), range_super_union(), range_union_internal(), rbound_bsearch(), single_bound_cmp(), and spg_range_quad_inner_consistent().
int range_compare | ( | const void * | key1, |
const void * | key2, | ||
void * | arg | ||
) |
Definition at line 2129 of file rangetypes.c.
References arg, cmp(), range_cmp_bounds(), and range_deserialize().
Referenced by multirange_canonicalize().
Datum range_constructor2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 377 of file rangetypes.c.
References get_fn_expr_rettype(), lower(), make_range(), PG_ARGISNULL, PG_GETARG_DATUM, PG_RETURN_RANGE_P, range(), range_get_typcache(), and upper().
Datum range_constructor3 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 406 of file rangetypes.c.
References ereport, errcode(), errmsg(), ERROR, get_fn_expr_rettype(), lower(), make_range(), PG_ARGISNULL, PG_GETARG_DATUM, PG_GETARG_TEXT_PP, PG_RETURN_RANGE_P, range(), range_get_typcache(), RANGE_LB_INC, range_parse_flags(), RANGE_UB_INC, text_to_cstring(), and upper().
Datum range_contained_by | ( | PG_FUNCTION_ARGS | ) |
Definition at line 651 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_contained_by_internal(), range_get_typcache(), and RangeTypeGetOid.
bool range_contained_by_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 2618 of file rangetypes.c.
References range_contains_internal().
Referenced by range_contained_by(), range_gist_consistent_leaf_range(), and spg_range_quad_leaf_consistent().
Datum range_contains | ( | PG_FUNCTION_ARGS | ) |
Definition at line 638 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_contains_internal(), range_get_typcache(), and RangeTypeGetOid.
Datum range_contains_elem | ( | PG_FUNCTION_ARGS | ) |
Definition at line 544 of file rangetypes.c.
References PG_GETARG_DATUM, PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_contains_elem_internal(), range_get_typcache(), RangeTypeGetOid, and val.
bool range_contains_elem_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r, | ||
Datum | val | ||
) |
Definition at line 2627 of file rangetypes.c.
References cmp(), DatumGetInt32(), FunctionCall2Coll(), lower(), range_deserialize(), TypeCacheEntry::rng_cmp_proc_finfo, TypeCacheEntry::rng_collation, upper(), and val.
Referenced by elem_contained_by_range(), range_contains_elem(), range_gist_consistent_int_element(), range_gist_consistent_leaf_element(), and spg_range_quad_leaf_consistent().
Datum range_contains_elem_support | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2213 of file rangetypes.c.
References FuncExpr::args, Assert, SupportRequestSimplify::fcall, find_simplified_clause(), IsA, linitial, list_length(), lsecond, PG_GETARG_POINTER, PG_RETURN_POINTER, and SupportRequestSimplify::root.
bool range_contains_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 2586 of file rangetypes.c.
References elog, ERROR, range_cmp_bounds(), range_deserialize(), and RangeTypeGetOid.
Referenced by range_contained_by_internal(), range_contains(), range_gist_consistent_int_range(), range_gist_consistent_leaf_range(), and spg_range_quad_leaf_consistent().
|
static |
Definition at line 2507 of file rangetypes.c.
References appendStringInfoChar(), appendStringInfoString(), buf, initStringInfo(), pstrdup(), range_bound_escape(), RANGE_EMPTY, RANGE_EMPTY_LITERAL, RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RANGE_LB_INC, and RANGE_UB_INC.
Referenced by range_out().
void range_deserialize | ( | TypeCacheEntry * | typcache, |
const RangeType * | range, | ||
RangeBound * | lower, | ||
RangeBound * | upper, | ||
bool * | empty | ||
) |
Definition at line 1856 of file rangetypes.c.
References Assert, att_addlength_pointer, att_align_pointer, fetch_att(), lower(), range(), RANGE_EMPTY, RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RANGE_LB_INC, RANGE_LB_INF, RANGE_UB_INC, RANGE_UB_INF, RangeTypeGetOid, TypeCacheEntry::rngelemtype, typalign, TypeCacheEntry::typalign, TypeCacheEntry::typbyval, TypeCacheEntry::type_id, TypeCacheEntry::typlen, upper(), and VARSIZE.
Referenced by calc_hist_selectivity(), compute_range_stats(), daterange_canonical(), find_simplified_clause(), getQuadrant(), hash_range(), hash_range_extended(), int4range_canonical(), int8range_canonical(), multirange_contains_range_internal(), multirange_overleft_range(), multirange_overright_range(), multirange_union_range_equal(), range_adjacent_internal(), range_adjacent_multirange_internal(), range_after_internal(), range_after_multirange_internal(), range_before_internal(), range_before_multirange_internal(), range_cmp(), range_compare(), range_contains_elem_internal(), range_contains_internal(), range_contains_multirange_internal(), range_eq_internal(), range_gist_double_sorting_split(), range_gist_penalty(), range_gist_single_sorting_split(), range_intersect_internal(), range_lower(), range_minus_internal(), range_out(), range_overlaps_internal(), range_overlaps_multirange_internal(), range_overleft_internal(), range_overleft_multirange_internal(), range_overright_internal(), range_overright_multirange_internal(), range_send(), range_split_internal(), range_super_union(), range_union_internal(), range_upper(), spg_range_quad_inner_consistent(), and spg_range_quad_picksplit().
Datum range_empty | ( | PG_FUNCTION_ARGS | ) |
Definition at line 491 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, RANGE_EMPTY, and range_get_flags().
Datum range_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 605 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_eq_internal(), range_get_typcache(), and RangeTypeGetOid.
bool range_eq_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 573 of file rangetypes.c.
References elog, ERROR, range_cmp_bounds(), range_deserialize(), and RangeTypeGetOid.
Referenced by range_eq(), range_gist_consistent_leaf_range(), range_gist_same(), range_ne_internal(), and spg_range_quad_leaf_consistent().
Datum range_ge | ( | PG_FUNCTION_ARGS | ) |
char range_get_flags | ( | const RangeType * | range | ) |
Definition at line 1923 of file rangetypes.c.
References range(), and VARSIZE.
Referenced by get_gist_range_class(), hash_range(), hash_range_extended(), range_empty(), range_gist_same(), range_lower_inc(), range_lower_inf(), range_out(), range_send(), range_super_union(), range_upper_inc(), and range_upper_inf().
TypeCacheEntry* range_get_typcache | ( | FunctionCallInfo | fcinfo, |
Oid | rngtypid | ||
) |
Definition at line 1703 of file rangetypes.c.
References elog, ERROR, FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_extra, if(), lookup_type_cache(), TypeCacheEntry::rngelemtype, TypeCacheEntry::type_id, and TYPECACHE_RANGE_INFO.
Referenced by daterange_canonical(), elem_contained_by_range(), hash_range(), hash_range_extended(), int4range_canonical(), int8range_canonical(), multirange_gist_consistent(), range_adjacent(), range_after(), range_before(), range_cmp(), range_constructor2(), range_constructor3(), range_contained_by(), range_contains(), range_contains_elem(), range_eq(), range_gist_consistent(), range_gist_penalty(), range_gist_picksplit(), range_gist_same(), range_gist_union(), range_intersect(), range_intersect_agg_transfn(), range_lower(), range_merge(), range_minus(), range_ne(), range_overlaps(), range_overleft(), range_overright(), range_typanalyze(), range_union(), range_upper(), rangesel(), spg_range_quad_choose(), spg_range_quad_inner_consistent(), spg_range_quad_leaf_consistent(), and spg_range_quad_picksplit().
Datum range_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1319 of file rangetypes.c.
References cmp(), PG_RETURN_BOOL, and range_cmp().
Datum range_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 88 of file rangetypes.c.
References check_stack_depth(), get_range_io_data(), InputFunctionCallSafe(), IOFunc_input, lower(), make_range(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_RANGE_P, range(), RANGE_EMPTY, RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RANGE_LB_INC, RANGE_LB_INF, range_parse(), RANGE_UB_INC, RANGE_UB_INF, RangeIOData::typcache, RangeIOData::typioparam, RangeIOData::typioproc, and upper().
Datum range_intersect | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1127 of file rangetypes.c.
References elog, ERROR, PG_GETARG_RANGE_P, PG_RETURN_RANGE_P, range_get_typcache(), range_intersect_internal(), and RangeTypeGetOid.
Datum range_intersect_agg_transfn | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1219 of file rangetypes.c.
References AggCheckCallContext(), elog, ERROR, get_fn_expr_argtype(), PG_GETARG_RANGE_P, PG_RETURN_RANGE_P, range_get_typcache(), range_intersect_internal(), and type_is_range().
RangeType* range_intersect_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 1143 of file rangetypes.c.
References make_empty_range(), make_range(), range_cmp_bounds(), range_deserialize(), and range_overlaps_internal().
Referenced by multirange_intersect_internal(), range_intersect(), and range_intersect_agg_transfn().
Datum range_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1303 of file rangetypes.c.
References cmp(), PG_RETURN_BOOL, and range_cmp().
Datum range_lower | ( | PG_FUNCTION_ARGS | ) |
Definition at line 446 of file rangetypes.c.
References lower(), PG_GETARG_RANGE_P, PG_RETURN_DATUM, PG_RETURN_NULL, range_deserialize(), range_get_typcache(), RangeTypeGetOid, and upper().
Datum range_lower_inc | ( | PG_FUNCTION_ARGS | ) |
Definition at line 501 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_get_flags(), and RANGE_LB_INC.
Datum range_lower_inf | ( | PG_FUNCTION_ARGS | ) |
Definition at line 521 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_get_flags(), and RANGE_LB_INF.
Datum range_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1295 of file rangetypes.c.
References cmp(), PG_RETURN_BOOL, and range_cmp().
Datum range_merge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1114 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_RANGE_P, range_get_typcache(), range_union_internal(), and RangeTypeGetOid.
Datum range_minus | ( | PG_FUNCTION_ARGS | ) |
Definition at line 972 of file rangetypes.c.
References elog, ERROR, PG_GETARG_RANGE_P, PG_RETURN_NULL, PG_RETURN_RANGE_P, range_get_typcache(), range_minus_internal(), and RangeTypeGetOid.
RangeType* range_minus_internal | ( | TypeCacheEntry * | typcache, |
RangeType * | r1, | ||
RangeType * | r2 | ||
) |
Definition at line 993 of file rangetypes.c.
References elog, ereport, errcode(), errmsg(), ERROR, RangeBound::inclusive, RangeBound::lower, make_empty_range(), make_range(), range_cmp_bounds(), and range_deserialize().
Referenced by multirange_minus_internal(), and range_minus().
Datum range_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 625 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_get_typcache(), range_ne_internal(), and RangeTypeGetOid.
bool range_ne_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 618 of file rangetypes.c.
References range_eq_internal().
Referenced by range_ne().
Datum range_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 137 of file rangetypes.c.
References check_stack_depth(), get_range_io_data(), IOFunc_output, lower(), OutputFunctionCall(), PG_GETARG_RANGE_P, PG_RETURN_CSTRING, range(), range_deparse(), range_deserialize(), range_get_flags(), RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RangeTypeGetOid, RangeIOData::typcache, RangeIOData::typioproc, and upper().
Referenced by anycompatiblerange_out(), and anyrange_out().
Datum range_overlaps | ( | PG_FUNCTION_ARGS | ) |
Definition at line 874 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_get_typcache(), range_overlaps_internal(), and RangeTypeGetOid.
bool range_overlaps_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 841 of file rangetypes.c.
References elog, ERROR, range_cmp_bounds(), range_deserialize(), and RangeTypeGetOid.
Referenced by multirange_intersect_internal(), multirange_minus_internal(), range_gist_consistent_int_range(), range_gist_consistent_leaf_range(), range_intersect_internal(), range_overlaps(), range_union_internal(), and spg_range_quad_leaf_consistent().
Datum range_overleft | ( | PG_FUNCTION_ARGS | ) |
Definition at line 915 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_get_typcache(), range_overleft_internal(), and RangeTypeGetOid.
bool range_overleft_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 887 of file rangetypes.c.
References elog, ERROR, range_cmp_bounds(), range_deserialize(), and RangeTypeGetOid.
Referenced by multirange_intersect_internal(), range_gist_consistent_int_range(), range_gist_consistent_leaf_range(), range_overleft(), and spg_range_quad_leaf_consistent().
Datum range_overright | ( | PG_FUNCTION_ARGS | ) |
Definition at line 956 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_get_typcache(), range_overright_internal(), and RangeTypeGetOid.
bool range_overright_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2 | ||
) |
Definition at line 928 of file rangetypes.c.
References elog, ERROR, range_cmp_bounds(), range_deserialize(), and RangeTypeGetOid.
Referenced by range_gist_consistent_int_range(), range_gist_consistent_leaf_range(), range_overright(), and spg_range_quad_leaf_consistent().
|
static |
Definition at line 2322 of file rangetypes.c.
References ereturn, errcode(), errdetail(), errmsg(), pg_strncasecmp(), RANGE_EMPTY, RANGE_EMPTY_LITERAL, RANGE_LB_INC, RANGE_LB_INF, range_parse_bound(), RANGE_UB_INC, and RANGE_UB_INF.
Referenced by range_in().
|
static |
Definition at line 2438 of file rangetypes.c.
References appendStringInfoChar(), buf, ereturn, errcode(), errdetail(), errmsg(), and initStringInfo().
Referenced by range_parse().
|
static |
Definition at line 2247 of file rangetypes.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, RANGE_LB_INC, and RANGE_UB_INC.
Referenced by range_constructor3().
Datum range_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 177 of file rangetypes.c.
References appendBinaryStringInfo(), buf, check_stack_depth(), StringInfoData::data, get_range_io_data(), initStringInfo(), IOFunc_receive, lower(), make_range(), pfree(), PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_RANGE_P, pq_getmsgbyte(), pq_getmsgbytes(), pq_getmsgend(), pq_getmsgint(), range(), RANGE_EMPTY, RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RANGE_LB_INC, RANGE_LB_INF, RANGE_UB_INC, RANGE_UB_INF, ReceiveFunctionCall(), RangeIOData::typcache, RangeIOData::typioparam, RangeIOData::typioproc, and upper().
Datum range_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 261 of file rangetypes.c.
References buf, check_stack_depth(), get_range_io_data(), IOFunc_send, lower(), makeStringInfo(), PG_GETARG_RANGE_P, PG_RETURN_BYTEA_P, PointerGetDatum(), pq_begintypsend(), pq_endtypsend(), pq_sendbyte(), pq_sendbytes(), pq_sendint32(), range(), range_deserialize(), range_get_flags(), RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RangeTypeGetOid, SendFunctionCall(), RangeIOData::typcache, RangeIOData::typioproc, upper(), VARDATA, VARHDRSZ, and VARSIZE.
RangeType* range_serialize | ( | TypeCacheEntry * | typcache, |
RangeBound * | lower, | ||
RangeBound * | upper, | ||
bool | empty, | ||
struct Node * | escontext | ||
) |
Definition at line 1727 of file rangetypes.c.
References Assert, cmp(), datum_compute_size(), datum_write(), ereturn, errcode(), errmsg(), lower(), MAXALIGN, palloc0(), PG_DETOAST_DATUM_PACKED, PointerGetDatum(), range(), range_cmp_bound_values(), RANGE_EMPTY, RANGE_HAS_LBOUND, RANGE_HAS_UBOUND, RANGE_LB_INC, RANGE_LB_INF, RANGE_UB_INC, RANGE_UB_INF, TypeCacheEntry::rngelemtype, SET_VARSIZE, typalign, TypeCacheEntry::typalign, TypeCacheEntry::typbyval, TypeCacheEntry::type_id, TypeCacheEntry::typlen, TypeCacheEntry::typstorage, and upper().
Referenced by compute_range_stats(), daterange_canonical(), int4range_canonical(), int8range_canonical(), make_range(), multirangesel(), rangesel(), and spg_range_quad_picksplit().
void range_set_contain_empty | ( | RangeType * | range | ) |
Definition at line 1937 of file rangetypes.c.
References range(), RANGE_CONTAIN_EMPTY, and VARSIZE.
Referenced by range_super_union().
bool range_split_internal | ( | TypeCacheEntry * | typcache, |
const RangeType * | r1, | ||
const RangeType * | r2, | ||
RangeType ** | output1, | ||
RangeType ** | output2 | ||
) |
Definition at line 1182 of file rangetypes.c.
References RangeBound::inclusive, RangeBound::lower, make_range(), range_cmp_bounds(), and range_deserialize().
Referenced by multirange_minus_internal().
Datum range_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1098 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_RANGE_P, range_get_typcache(), range_union_internal(), and RangeTypeGetOid.
RangeType* range_union_internal | ( | TypeCacheEntry * | typcache, |
RangeType * | r1, | ||
RangeType * | r2, | ||
bool | strict | ||
) |
Definition at line 1052 of file rangetypes.c.
References DatumGetBool(), elog, ereport, errcode(), errmsg(), ERROR, make_range(), range_adjacent_internal(), range_cmp_bounds(), range_deserialize(), range_overlaps_internal(), and RangeTypeGetOid.
Referenced by multirange_canonicalize(), range_merge(), and range_union().
Datum range_upper | ( | PG_FUNCTION_ARGS | ) |
Definition at line 467 of file rangetypes.c.
References lower(), PG_GETARG_RANGE_P, PG_RETURN_DATUM, PG_RETURN_NULL, range_deserialize(), range_get_typcache(), RangeTypeGetOid, and upper().
Datum range_upper_inc | ( | PG_FUNCTION_ARGS | ) |
Definition at line 511 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_get_flags(), and RANGE_UB_INC.
Datum range_upper_inf | ( | PG_FUNCTION_ARGS | ) |
Definition at line 531 of file rangetypes.c.
References PG_GETARG_RANGE_P, PG_RETURN_BOOL, range_get_flags(), and RANGE_UB_INF.
Datum tsrange_subdiff | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1664 of file rangetypes.c.
References PG_GETARG_TIMESTAMP, PG_RETURN_FLOAT8, and USECS_PER_SEC.
Datum tstzrange_subdiff | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1675 of file rangetypes.c.
References PG_GETARG_TIMESTAMP, PG_RETURN_FLOAT8, and USECS_PER_SEC.