MobilityDB 1.3
Loading...
Searching...
No Matches
Functions
span.c File Reference

General functions for span types (a.k.a. More...

#include "temporal/span.h"
#include <assert.h>
#include <postgres.h>
#include <catalog/pg_type_d.h>
#include <utils/rangetypes.h>
#include <utils/timestamp.h>
#include <meos.h>
#include <meos_internal.h>
#include "temporal/set.h"
#include "temporal/temporal.h"
#include "temporal/type_inout.h"
#include "temporal/type_util.h"
#include "pg_temporal/meos_catalog.h"
#include "pg_temporal/temporal.h"
#include "pg_temporal/type_util.h"

Functions

Datum Datespan_duration (PG_FUNCTION_ARGS)
 Return the duration of a date span @sqlfn duration() More...
 
Datum Datespan_to_tstzspan (PG_FUNCTION_ARGS)
 Convert a date span into a timestamptz span @sqlfn tstzspan() More...
 
Datum Float_round (PG_FUNCTION_ARGS)
 Return a float with the precision of the values set to a number of decimal places @sqlfn round() More...
 
Datum Floatspan_ceil (PG_FUNCTION_ARGS)
 Return a float span rounded up to the nearest integer @sqlfn ceil() More...
 
Datum Floatspan_degrees (PG_FUNCTION_ARGS)
 Return a float span with the values converted to degrees @sqlfn degrees() More...
 
Datum Floatspan_floor (PG_FUNCTION_ARGS)
 Return a float span rounded down to the nearest integer @sqlfn floor() More...
 
Datum Floatspan_radians (PG_FUNCTION_ARGS)
 Return a float set with the values converted to radians @sqlfn radians() More...
 
Datum Floatspan_round (PG_FUNCTION_ARGS)
 Return a float span with the precision of the values set to a number of decimal places @sqlfn round() More...
 
Datum Floatspan_to_intspan (PG_FUNCTION_ARGS)
 Convert a float span into a integer span @sqlfn intspan() More...
 
Datum Intspan_to_floatspan (PG_FUNCTION_ARGS)
 Convert an integer span into a float span @sqlfn floatspan() More...
 
Datum Numspan_expand (PG_FUNCTION_ARGS)
 Return a number span with its bounds expanded or shrinded by a value. More...
 
Datum Numspan_scale (PG_FUNCTION_ARGS)
 Return a number span scaled by a value. More...
 
Datum Numspan_shift (PG_FUNCTION_ARGS)
 Return a number span shifted by a value. More...
 
Datum Numspan_shift_scale (PG_FUNCTION_ARGS)
 Return a number span shifted and scaled by two values. More...
 
Datum Numspan_width (PG_FUNCTION_ARGS)
 Return the width of a number span @sqlfn width() More...
 
void range_set_span (RangeType *range, TypeCacheEntry *typcache, Span *result)
 Convert a PostgreSQL range into a span. More...
 
Datum Range_to_span (PG_FUNCTION_ARGS)
 Convert a PostgreSQL range into a span @sqlfn intspan(), tstzspan() More...
 
Datum Set_spans (PG_FUNCTION_ARGS)
 Return an array of spans from the elements of a set @sqlfn spans() More...
 
Datum Set_split_each_n_spans (PG_FUNCTION_ARGS)
 Return an array of spans from the elements of a set obtained by merging a given number of successive elements @sqlfn splitEachNSpans() More...
 
Datum Set_split_n_spans (PG_FUNCTION_ARGS)
 Return an array of N spans from the elements of a set @sqlfn splitNspans() More...
 
Datum Set_to_span (PG_FUNCTION_ARGS)
 Convert a set into a span @sqlfn span() More...
 
Datum Span_as_hexwkb (PG_FUNCTION_ARGS)
 Return the ASCII hex-encoded Well-Known Binary (HexWKB) representation of a span @sqlfn asHexWKB() More...
 
Datum Span_as_text (PG_FUNCTION_ARGS)
 Return the Well-Known Text (WKT) representation of a span @sqlfn asText() More...
 
Datum Span_as_wkb (PG_FUNCTION_ARGS)
 Return the Well-Known Binary (WKB) representation of a span @sqlfn asBinary() More...
 
Datum Span_cmp (PG_FUNCTION_ARGS)
 Return -1, 0, or 1 depending on whether the first span is less than, equal to, or greater than the second one @sqlfn span_cmp() More...
 
Datum Span_constructor (PG_FUNCTION_ARGS)
 Return a span from the bounds @sqlfn intspan(), floatspan(), ... More...
 
Datum Span_eq (PG_FUNCTION_ARGS)
 Return true if the first span is equal to the second one @sqlfn span_eq() More...
 
Datum Span_from_hexwkb (PG_FUNCTION_ARGS)
 Return a span from its ASCII hex-encoded Well-Known Binary (HexWKB) representation @sqlfn intspanFromHexWKB(), floatspanFromHexWKB(), ... More...
 
Datum Span_from_wkb (PG_FUNCTION_ARGS)
 Return a span from its Well-Known Binary (WKB) representation @sqlfn intspanFromBinary(), floatspanFromBinary(), ... More...
 
Datum Span_ge (PG_FUNCTION_ARGS)
 Return true if the first span is greater than or equal to the second one @sqlfn span_ge() More...
 
Datum Span_gt (PG_FUNCTION_ARGS)
 Return true if the first span is greater than the second one @sqlfn span_gt() More...
 
Datum Span_hash (PG_FUNCTION_ARGS)
 Return the 32-bit hash value of a span @sqlfn span_hash() More...
 
Datum Span_hash_extended (PG_FUNCTION_ARGS)
 Return the 64-bit hash value of a span using a seed @sqlfn hash_extended() More...
 
Datum Span_in (PG_FUNCTION_ARGS)
 Return a span from its Well-Known Text (WKT) representation @sqlfn span_in() More...
 
Datum Span_le (PG_FUNCTION_ARGS)
 Return true if the first span is less than or equal to the second one @sqlfn span_le() More...
 
Datum Span_lower (PG_FUNCTION_ARGS)
 Return the lower bound of a span @sqlfn lower() More...
 
Datum Span_lower_inc (PG_FUNCTION_ARGS)
 Return true if the lower bound of a span is inclusive @sqlfn lower_inc() More...
 
Datum Span_lt (PG_FUNCTION_ARGS)
 Return true if the first span is less than the second one @sqlfn span_lt() More...
 
Datum Span_ne (PG_FUNCTION_ARGS)
 Return true if the first span is different from the second one @sqlfn span_ne() More...
 
Datum Span_out (PG_FUNCTION_ARGS)
 Return the Well-Known Text (WKT) representation of a span @sqlfn span_out() More...
 
Datum Span_recv (PG_FUNCTION_ARGS)
 Return a span from its Well-Known Binary (WKB) representation @sqlfn span_recv() More...
 
Datum Span_send (PG_FUNCTION_ARGS)
 Return the Well-Known Binary (WKB) representation of a span @sqlfn span_send() More...
 
Datum Span_to_range (PG_FUNCTION_ARGS)
 Convert a span into a range @sqlfn int4range(), tstzrange() More...
 
Datum Span_upper (PG_FUNCTION_ARGS)
 Return the upper bound of a span @sqlfn upper() More...
 
Datum Span_upper_inc (PG_FUNCTION_ARGS)
 Return true if the upper bound of a span is inclusive @sqlfn lower_inc() More...
 
Datum Timestamptz_shift (PG_FUNCTION_ARGS)
 Return a timestamptz shifted by an interval @sqlfn shift() More...
 
Datum Tstzspan_duration (PG_FUNCTION_ARGS)
 Return the duration of a timestamptz span @sqlfn duration() More...
 
Datum Tstzspan_expand (PG_FUNCTION_ARGS)
 Return a timstamptz span expanded/shrinked by an interval @sqlfn expand() More...
 
Datum Tstzspan_scale (PG_FUNCTION_ARGS)
 Return a timestamptz span scaled by an interval @sqlfn scale() More...
 
Datum Tstzspan_shift (PG_FUNCTION_ARGS)
 Return a timestamptz span shifted by an interval @sqlfn shift() More...
 
Datum Tstzspan_shift_scale (PG_FUNCTION_ARGS)
 Return a timestamptz span shifted and scaled by two intervals @sqlfn shiftScale() More...
 
Datum Tstzspan_to_datespan (PG_FUNCTION_ARGS)
 Convert a timestamptz span into a date span @sqlfn datespan() More...
 
Datum Value_to_span (PG_FUNCTION_ARGS)
 Convert a value into a span @sqlfn span() More...
 

Detailed Description

General functions for span types (a.k.a.

ranges) composed of two Datum values and two Boolean values stating whether the bounds are inclusive or not