MobilityDB  1.0
Functions | Variables
temporal.c File Reference

Basic functions for temporal types of any subtype. More...

#include "general/temporal.h"
#include <assert.h>
#include <access/heapam.h>
#include <access/htup_details.h>
#include <access/tuptoaster.h>
#include <catalog/namespace.h>
#include <libpq/pqformat.h>
#include <utils/builtins.h>
#include <utils/fmgroids.h>
#include <utils/lsyscache.h>
#include <utils/rel.h>
#include <utils/timestamp.h>
#include "general/period.h"
#include "general/timeops.h"
#include "general/temporaltypes.h"
#include "general/tempcache.h"
#include "general/temporal_util.h"
#include "general/temporal_boxops.h"
#include "general/temporal_parser.h"
#include "general/rangetypes_ext.h"
#include "point/tpoint_spatialfuncs.h"
#include "npoint/tnpoint_static.h"
#include "npoint/tnpoint_spatialfuncs.h"
Include dependency graph for temporal.c:

Functions

void _PG_init (void)
 Initialize the extension. More...
 
const char * tempsubtype_name (int16 subtype)
 Returns the string representation of the subtype of the temporal type corresponding to the enum value. More...
 
bool tempsubtype_from_string (const char *str, int16 *subtype)
 Returns the enum value corresponding to the string representation of the concrete subtype of the temporal type. More...
 
static Temporaltemporal_valid_typmod (Temporal *temp, int32_t typmod)
 Ensures that the temporal type of the temporal value corresponds to the typmod. More...
 
void ensure_valid_tempsubtype (int16 subtype)
 Ensures that the temporal type is valid. More...
 
void ensure_valid_tempsubtype_all (int16 subtype)
 Ensures that the temporal type is valid. More...
 
void ensure_seq_subtypes (int16 subtype)
 Ensures that the temporal type is a sequence (set) More...
 
void ensure_tinstantarr (TInstant **instants, int count)
 Ensures that the elements of the array are of instant subtype. More...
 
void ensure_linear_interpolation (int16 flags)
 Ensure that the temporal value has linear interpolation. More...
 
void ensure_common_dimension (int16 flags1, int16 flags2)
 Ensure that the temporal values have at least one common dimension. More...
 
void ensure_same_base_type (const Temporal *temp1, const Temporal *temp2)
 Ensures that the two temporal values have the same base type. More...
 
void ensure_same_interpolation (const Temporal *temp1, const Temporal *temp2)
 Ensures that the two temporal values have the same interpolation. More...
 
void ensure_increasing_timestamps (const TInstant *inst1, const TInstant *inst2, bool merge)
 Ensures that the timestamp of the first temporal instant is smaller (or equal if the merge parameter is true) than the one of the second temporal instant. More...
 
void ensure_valid_tinstantarr (const TInstant **instants, int count, bool merge, int16 subtype)
 Ensures that all temporal instant values of the array have increasing timestamp (or may be equal if the merge parameter is true), and if they are temporal points, have the same srid and the same dimensionality. More...
 
void ensure_valid_tsequencearr (const TSequence **sequences, int count)
 Ensures that all temporal instant values of the array have increasing timestamp, and if they are temporal points, have the same srid and the same dimensionality. More...
 
void ensure_positive_datum (Datum size, Oid type)
 Ensures that the number is positive. More...
 
void ensure_valid_duration (const Interval *duration)
 Ensures that the interval is a positive and absolute duration. More...
 
void ensure_non_empty_array (ArrayType *array)
 Ensures that the array is not empty. More...
 
Temporaltemporal_copy (const Temporal *temp)
 Returns a copy of the temporal value. More...
 
bool intersection_temporal_temporal (const Temporal *temp1, const Temporal *temp2, TIntersection mode, Temporal **inter1, Temporal **inter2)
 Temporally intersect the two temporal values. More...
 
PGDLLEXPORT Datum mobilitydb_version (PG_FUNCTION_ARGS)
 Version of the MobilityDB extension. More...
 
PGDLLEXPORT Datum mobilitydb_full_version (PG_FUNCTION_ARGS)
 Versions of the MobilityDB extension and its dependencies. More...
 
PGDLLEXPORT Datum temporal_in (PG_FUNCTION_ARGS)
 Generic input function for temporal types. More...
 
char * temporal_to_string (const Temporal *temp, char *(*value_out)(Oid, Datum))
 Returns the string representation of the temporal value (dispatch function) More...
 
PGDLLEXPORT Datum temporal_out (PG_FUNCTION_ARGS)
 Generic output function for temporal types. More...
 
void temporal_write (const Temporal *temp, StringInfo buf)
 Write the binary representation of the temporal value into the buffer (dispatch function) More...
 
PGDLLEXPORT Datum temporal_send (PG_FUNCTION_ARGS)
 
Temporaltemporal_read (StringInfo buf, Oid basetypid)
 Returns a new temporal value from its binary representation read from the buffer (dispatch function) More...
 
PGDLLEXPORT Datum temporal_recv (PG_FUNCTION_ARGS)
 Generic receive function for temporal types. More...
 
PGDLLEXPORT Datum temporal_typmod_in (PG_FUNCTION_ARGS)
 Input typmod information for temporal types. More...
 
PGDLLEXPORT Datum temporal_typmod_out (PG_FUNCTION_ARGS)
 Output typmod information for temporal types. More...
 
PGDLLEXPORT Datum temporal_enforce_typmod (PG_FUNCTION_ARGS)
 Enforce typmod information for temporal types. More...
 
PGDLLEXPORT Datum tinstant_constructor (PG_FUNCTION_ARGS)
 Construct a temporal instant value from the arguments. More...
 
PGDLLEXPORT Datum tinstantset_constructor (PG_FUNCTION_ARGS)
 Construct a temporal instant set value from the array of temporal instant values. More...
 
Datum tsequence_constructor (FunctionCallInfo fcinfo, bool get_interp)
 Construct a temporal sequence value from the array of temporal instant values. More...
 
PGDLLEXPORT Datum tstepseq_constructor (PG_FUNCTION_ARGS)
 Construct a temporal sequence value with stepwise interpolation from the array of temporal instant values. More...
 
PGDLLEXPORT Datum tlinearseq_constructor (PG_FUNCTION_ARGS)
 Construct a temporal sequence value with linear or stepwise interpolation from the array of temporal instant values. More...
 
PGDLLEXPORT Datum tsequenceset_constructor (PG_FUNCTION_ARGS)
 Construct a temporal sequence set value from the array of temporal sequence values. More...
 
PGDLLEXPORT Datum temporal_append_tinstant (PG_FUNCTION_ARGS)
 Append an instant to the end of a temporal value. More...
 
static void temporal_convert_same_type (const Temporal *temp1, const Temporal *temp2, Temporal **out1, Temporal **out2)
 Convert two temporal values into a common subtype. More...
 
Temporaltemporal_merge_internal (const Temporal *temp1, const Temporal *temp2)
 
PGDLLEXPORT Datum temporal_merge (PG_FUNCTION_ARGS)
 Merge the two temporal values. More...
 
static Temporal ** temporalarr_convert_subtype (Temporal **temparr, int count, int16 subtype)
 Convert the array of temporal values into a common subtype. More...
 
PGDLLEXPORT Datum temporal_merge_array (PG_FUNCTION_ARGS)
 Merge the array of temporal values. More...
 
Temporaltemporal_from_base (const Temporal *temp, Datum value, Oid basetypid, bool linear)
 Transform a temporal value into a constant value with the same time frame (internal function) More...
 
RangeType * tint_range (const Temporal *temp)
 Cast a temporal integer to an intrange. More...
 
PGDLLEXPORT Datum tint_to_range (PG_FUNCTION_ARGS)
 Cast the temporal integer value as an intrange. More...
 
PGDLLEXPORT Datum tfloat_to_range (PG_FUNCTION_ARGS)
 Cast the temporal integer value as an intrange. More...
 
Temporaltint_to_tfloat_internal (Temporal *temp)
 Cast the temporal integer value as a temporal float value (dispatch function) More...
 
PGDLLEXPORT Datum tint_to_tfloat (PG_FUNCTION_ARGS)
 Cast the temporal integer value as a temporal float value. More...
 
Temporaltfloat_to_tint_internal (Temporal *temp)
 Cast the temporal float value as a temporal integer value (dispatch function) More...
 
PGDLLEXPORT Datum tfloat_to_tint (PG_FUNCTION_ARGS)
 Cast the temporal float value as a temporal integer value. More...
 
void temporal_period (Period *p, const Temporal *temp)
 Returns the bounding period on which the temporal value is defined (dispatch function) More...
 
PGDLLEXPORT Datum temporal_to_period (PG_FUNCTION_ARGS)
 Returns the bounding period on which the temporal value is defined. More...
 
PGDLLEXPORT Datum temporal_to_tinstant (PG_FUNCTION_ARGS)
 Transform the temporal value into a temporal instant value. More...
 
PGDLLEXPORT Datum temporal_to_tinstantset (PG_FUNCTION_ARGS)
 Transform the temporal value into a temporal instant set value. More...
 
PGDLLEXPORT Datum temporal_to_tsequence (PG_FUNCTION_ARGS)
 Transform the temporal value into a temporal sequence value. More...
 
PGDLLEXPORT Datum temporal_to_tsequenceset (PG_FUNCTION_ARGS)
 Transform the temporal value into a temporal sequence set value. More...
 
PGDLLEXPORT Datum tstep_to_linear (PG_FUNCTION_ARGS)
 Transform the temporal value with continuous base type from stepwise to linear interpolation. More...
 
Datum temporal_subtype (PG_FUNCTION_ARGS)
 Returns the string representation of the temporal type. More...
 
Datum temporal_interpolation (PG_FUNCTION_ARGS)
 Returns the string representation of the temporal interpolation. More...
 
PGDLLEXPORT Datum temporal_mem_size (PG_FUNCTION_ARGS)
 Returns the size in bytes of the temporal value. More...
 
Datum temporal_values_array (Temporal *temp)
 Returns the base values of the temporal value as a PostgreSQL array (dispatch function) More...
 
PGDLLEXPORT Datum temporal_get_values (PG_FUNCTION_ARGS)
 Returns the base values of the temporal value as an array. More...
 
Datum tfloat_ranges (const Temporal *temp)
 Returns the base values of the temporal float value as an array of ranges (dispatch function) More...
 
PGDLLEXPORT Datum tfloat_get_ranges (PG_FUNCTION_ARGS)
 Returns the base values of the temporal float value as an array of ranges. More...
 
PGDLLEXPORT Datum tinstant_get_value (PG_FUNCTION_ARGS)
 Returns the base value of the temporal instant value. More...
 
PeriodSettemporal_get_time_internal (const Temporal *temp)
 Returns the time on which the temporal value is defined as a period set (dispatch function) More...
 
PGDLLEXPORT Datum temporal_get_time (PG_FUNCTION_ARGS)
 Returns the time on which the temporal value is defined as a period set. More...
 
PGDLLEXPORT Datum tinstant_timestamp (PG_FUNCTION_ARGS)
 Returns the timestamp of the temporal instant value. More...
 
void * temporal_bbox_ptr (const Temporal *temp)
 Returns a pointer to the precomputed bounding box of the temporal value. More...
 
void temporal_bbox (void *box, const Temporal *temp)
 Set the first argument to the bounding box of the temporal value. More...
 
PGDLLEXPORT Datum tnumber_to_tbox (PG_FUNCTION_ARGS)
 Returns the bounding box of the temporal value. More...
 
RangeType * tnumber_value_range_internal (const Temporal *temp)
 Returns the value range of the temporal integer value (internal function) More...
 
PGDLLEXPORT Datum tnumber_value_range (PG_FUNCTION_ARGS)
 Returns the value range of the temporal integer value. More...
 
PGDLLEXPORT Datum temporal_start_value (PG_FUNCTION_ARGS)
 Returns the start base value of the temporal value. More...
 
PGDLLEXPORT Datum temporal_end_value (PG_FUNCTION_ARGS)
 Returns the end base value of the temporal value. More...
 
const TInstanttemporal_min_instant (const Temporal *temp)
 Returns a pointer to the instant with minimum base value of the temporal value. More...
 
Datum temporal_min_value_internal (const Temporal *temp)
 Returns the minimum base value of the temporal value (dispatch function) More...
 
PGDLLEXPORT Datum temporal_min_value (PG_FUNCTION_ARGS)
 Returns the minimum base value of the temporal value. More...
 
Datum temporal_max_value (PG_FUNCTION_ARGS)
 Returns the maximum base value of the temporal value. More...
 
PGDLLEXPORT Datum temporal_timespan (PG_FUNCTION_ARGS)
 Returns the timespan of the temporal value. More...
 
PGDLLEXPORT Datum temporal_duration (PG_FUNCTION_ARGS)
 Returns the duration of the temporal value. More...
 
PGDLLEXPORT Datum temporal_num_sequences (PG_FUNCTION_ARGS)
 Returns the number of sequences of the temporal sequence (set) value. More...
 
PGDLLEXPORT Datum temporal_start_sequence (PG_FUNCTION_ARGS)
 Returns the start sequence of the temporal sequence (set) value. More...
 
PGDLLEXPORT Datum temporal_end_sequence (PG_FUNCTION_ARGS)
 Returns the end sequence of the temporal sequence (set) value. More...
 
PGDLLEXPORT Datum temporal_sequence_n (PG_FUNCTION_ARGS)
 Returns the n-th sequence of the temporal sequence (set) value. More...
 
PGDLLEXPORT Datum temporal_sequences (PG_FUNCTION_ARGS)
 Returns the sequences of the temporal sequence (set) value as an array. More...
 
PGDLLEXPORT Datum temporal_segments (PG_FUNCTION_ARGS)
 Returns the segments of the temporal sequence (set) value as an array. More...
 
PGDLLEXPORT Datum temporal_num_instants (PG_FUNCTION_ARGS)
 Returns the number of distinct instants of the temporal value. More...
 
PGDLLEXPORT Datum temporal_start_instant (PG_FUNCTION_ARGS)
 Returns the start instant of the temporal value. More...
 
const TInstanttemporal_end_instant_internal (const Temporal *temp)
 Returns the end instant of the temporal value (internal function). More...
 
PGDLLEXPORT Datum temporal_end_instant (PG_FUNCTION_ARGS)
 Returns the end instant of the temporal value. More...
 
const TInstanttinstarr_inst_n (const Temporal *temp, int n)
 Returns the n-th instant of the temporal instant set or a temporal sequence value. More...
 
PGDLLEXPORT Datum temporal_instant_n (PG_FUNCTION_ARGS)
 Returns the n-th instant of the temporal value. More...
 
const TInstant ** temporal_instants_internal (const Temporal *temp, int *count)
 Returns the instants of the temporal value as a C array. More...
 
PGDLLEXPORT Datum temporal_instants (PG_FUNCTION_ARGS)
 Returns the distinct instants of the temporal value as an array. More...
 
TimestampTz temporal_start_timestamp_internal (const Temporal *temp)
 Returns the start timestamp of the temporal value (dispatch function) More...
 
PGDLLEXPORT Datum temporal_start_timestamp (PG_FUNCTION_ARGS)
 Returns the start timestamp of the temporal value. More...
 
PGDLLEXPORT Datum temporal_end_timestamp (PG_FUNCTION_ARGS)
 Returns the end timestamp of the temporal value. More...
 
PGDLLEXPORT Datum temporal_num_timestamps (PG_FUNCTION_ARGS)
 Returns the number of distinct timestamps of the temporal value. More...
 
PGDLLEXPORT Datum temporal_timestamp_n (PG_FUNCTION_ARGS)
 Returns the n-th distinct timestamp of the temporal value. More...
 
ArrayType * temporal_timestamps_internal (const Temporal *temp)
 Returns the distinct timestamps of the temporal value as an array. More...
 
PGDLLEXPORT Datum temporal_timestamps (PG_FUNCTION_ARGS)
 Returns the distinct timestamps of the temporal value as an array. More...
 
Temporaltemporal_shift_tscale_internal (Temporal *temp, bool shift, bool tscale, Interval *start, Interval *duration)
 Shift and/or scale the time span of the temporal value by the two intervals (internal function) More...
 
PGDLLEXPORT Datum temporal_shift (PG_FUNCTION_ARGS)
 Shift the time span of the temporal value by the interval. More...
 
PGDLLEXPORT Datum temporal_tscale (PG_FUNCTION_ARGS)
 Scale the time span of the temporal value by the interval. More...
 
PGDLLEXPORT Datum temporal_shift_tscale (PG_FUNCTION_ARGS)
 Shift and scale the time span of the temporal value by the two intervals. More...
 
bool temporal_bbox_ev_al_eq (const Temporal *temp, Datum value, bool ever)
 Returns true if the bounding box of the temporal value is ever equal to the base value. More...
 
bool temporal_bbox_ev_al_lt_le (const Temporal *temp, Datum value, bool ever)
 Returns true if the bounding box of the temporal value is ever/always less than or equal to the base value. More...
 
bool temporal_ever_eq_internal (const Temporal *temp, Datum value)
 Returns true if the temporal value is ever equal to the base value (internal function) More...
 
bool temporal_always_eq_internal (const Temporal *temp, Datum value)
 Returns true if the temporal value is always equal to the base value (internal function) More...
 
bool temporal_ever_lt_internal (const Temporal *temp, Datum value)
 Returns true if the temporal value is ever less than the base value (internal function) More...
 
bool temporal_always_lt_internal (const Temporal *temp, Datum value)
 Returns true if the temporal value is always less than the base value (internal function) More...
 
bool temporal_ever_le_internal (const Temporal *temp, Datum value)
 Returns true if the temporal value is ever less than or equal to the base value (internal function) More...
 
bool temporal_always_le_internal (const Temporal *temp, Datum value)
 Returns true if the temporal value is always less than or equal to the base value (internal function) More...
 
Datum temporal_ev_al_comp (FunctionCallInfo fcinfo, bool(*func)(const Temporal *, Datum))
 Generic function for the temporal ever/always comparison operators. More...
 
PGDLLEXPORT Datum temporal_ever_eq (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever equal to the base value. More...
 
PGDLLEXPORT Datum temporal_always_eq (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always equal to the base value. More...
 
PGDLLEXPORT Datum temporal_ever_ne (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever different from the base value. More...
 
PGDLLEXPORT Datum temporal_always_ne (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always different from the base value. More...
 
PGDLLEXPORT Datum temporal_ever_lt (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever less than the base value. More...
 
PGDLLEXPORT Datum temporal_always_lt (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always less than the base value. More...
 
PGDLLEXPORT Datum temporal_ever_le (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever less than or equal to the base value. More...
 
PGDLLEXPORT Datum temporal_always_le (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always less than or equal to the base value. More...
 
PGDLLEXPORT Datum temporal_ever_gt (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever greater than the base value. More...
 
PGDLLEXPORT Datum temporal_always_gt (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always greater than the base value. More...
 
PGDLLEXPORT Datum temporal_ever_ge (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever greater than or equal to the base value. More...
 
PGDLLEXPORT Datum temporal_always_ge (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always greater than or equal to the base value. More...
 
bool temporal_bbox_restrict_value (const Temporal *temp, Datum value)
 Returns true if the bounding box of the temporal value contains the base value. More...
 
Datum * temporal_bbox_restrict_values (const Temporal *temp, const Datum *values, int count, int *newcount)
 Returns the array of base values that are contained in the bounding box of the temporal value. More...
 
bool tnumber_bbox_restrict_range (const Temporal *temp, const RangeType *range)
 Returns true if the bounding box of the temporal number overlaps the range of base values. More...
 
RangeType ** tnumber_bbox_restrict_ranges (const Temporal *temp, RangeType **ranges, int count, int *newcount)
 Returns the array of ranges of base values that overlap with the bounding box of the temporal value. More...
 
static Temporaltemporal_restrict_value_internal (const Temporal *temp, Datum value, bool atfunc)
 Restricts the temporal value to the (complement of the) base value (dispatch function). More...
 
Datum temporal_restrict_value (FunctionCallInfo fcinfo, bool atfunc)
 Restricts the temporal value to the (complement of the) array of base values. More...
 
PGDLLEXPORT Datum temporal_at_value (PG_FUNCTION_ARGS)
 Restricts the temporal value to the base value. More...
 
PGDLLEXPORT Datum temporal_minus_value (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the base value. More...
 
static Temporaltemporal_restrict_values_internal (const Temporal *temp, Datum *values, int count, bool atfunc)
 Restricts the temporal value to the (complement of the) array of base values (dispatch function) More...
 
Datum temporal_restrict_values (FunctionCallInfo fcinfo, bool atfunc)
 Restricts the temporal value to the (complement of the) array of base values. More...
 
PGDLLEXPORT Datum temporal_at_values (PG_FUNCTION_ARGS)
 Restricts the temporal value to the array of base values. More...
 
PGDLLEXPORT Datum temporal_minus_values (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the array of base values. More...
 
Temporaltnumber_restrict_range_internal (const Temporal *temp, RangeType *range, bool atfunc)
 Restricts the temporal value to the (complement of the) range of base values (dispatch function) More...
 
Datum tnumber_restrict_range (FunctionCallInfo fcinfo, bool atfunc)
 
PGDLLEXPORT Datum tnumber_at_range (PG_FUNCTION_ARGS)
 Restricts the temporal value to the range of base values. More...
 
PGDLLEXPORT Datum tnumber_minus_range (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the range of base values. More...
 
static Temporaltnumber_restrict_ranges_internal (const Temporal *temp, RangeType **ranges, int count, bool atfunc)
 Restricts the temporal value to the (complement of the) array of ranges of base values (internal function) More...
 
Datum tnumber_restrict_ranges (FunctionCallInfo fcinfo, bool atfunc)
 Restricts the temporal value to the (complement of the) array of ranges of base values. More...
 
PGDLLEXPORT Datum tnumber_at_ranges (PG_FUNCTION_ARGS)
 Restricts the temporal value to the array of ranges of base values. More...
 
PGDLLEXPORT Datum tnumber_minus_ranges (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the array of ranges of base values. More...
 
Temporaltemporal_restrict_minmax_internal (const Temporal *temp, bool min, bool atfunc)
 Restricts the temporal value to (the complement of) the minimum base value (dispatch function) More...
 
Datum temporal_restrict_minmax (FunctionCallInfo fcinfo, bool min, bool atfunc)
 Restricts the temporal value to the minimum base value. More...
 
PGDLLEXPORT Datum temporal_at_min (PG_FUNCTION_ARGS)
 Restricts the temporal value to the minimum base value. More...
 
PGDLLEXPORT Datum temporal_minus_min (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the minimum base value. More...
 
PGDLLEXPORT Datum temporal_at_max (PG_FUNCTION_ARGS)
 Restricts the temporal value to the maximum base value. More...
 
PGDLLEXPORT Datum temporal_minus_max (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the maximum base value. More...
 
Temporaltemporal_restrict_timestamp_internal (const Temporal *temp, TimestampTz t, bool atfunc)
 Restricts the temporal value to the timestamp (dispatch function) More...
 
Datum temporal_restrict_timestamp (FunctionCallInfo fcinfo, bool atfunc)
 Restricts the temporal value to the (complement of the) timestamp. More...
 
PGDLLEXPORT Datum temporal_at_timestamp (PG_FUNCTION_ARGS)
 Restricts the temporal value to the timestamp. More...
 
PGDLLEXPORT Datum temporal_minus_timestamp (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the timestamp. More...
 
bool temporal_value_at_timestamp_inc (const Temporal *temp, TimestampTz t, Datum *value)
 Returns the base value of the temporal value at the timestamp when the timestamp may be at an exclusive bound. More...
 
PGDLLEXPORT Datum temporal_value_at_timestamp (PG_FUNCTION_ARGS)
 Returns the base value of the temporal value at the timestamp. More...
 
Datum temporal_restrict_timestampset (FunctionCallInfo fcinfo, bool atfunc)
 Restricts the temporal value to the (complement of the) timestamp set. More...
 
PGDLLEXPORT Datum temporal_at_timestampset (PG_FUNCTION_ARGS)
 Restricts the temporal value to the timestamp set. More...
 
PGDLLEXPORT Datum temporal_minus_timestampset (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the timestamp set. More...
 
Temporaltemporal_restrict_period_internal (const Temporal *temp, const Period *p, bool atfunc)
 Restricts the temporal value to the (complement of the) period (dispatch function) More...
 
Temporaltemporal_at_period_internal (const Temporal *temp, const Period *p)
 
Datum temporal_restrict_period (FunctionCallInfo fcinfo, bool atfunc)
 
PGDLLEXPORT Datum temporal_at_period (PG_FUNCTION_ARGS)
 Restricts the temporal value to the period. More...
 
PGDLLEXPORT Datum temporal_minus_period (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the period. More...
 
Temporaltemporal_restrict_periodset_internal (const Temporal *temp, const PeriodSet *ps, bool atfunc)
 Restricts the temporal value to the (complement of the) period set (dispatch function) More...
 
Datum temporal_restrict_periodset (FunctionCallInfo fcinfo, bool atfunc)
 Restricts the temporal value to the (complement of the) period set. More...
 
PGDLLEXPORT Datum temporal_at_periodset (PG_FUNCTION_ARGS)
 Restricts the temporal value to the period set. More...
 
PGDLLEXPORT Datum temporal_minus_periodset (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the period set. More...
 
Temporaltnumber_at_tbox_internal (const Temporal *temp, const TBOX *box)
 Restrict the temporal number to the temporal box (internal function) More...
 
Temporaltnumber_minus_tbox_internal (const Temporal *temp, const TBOX *box)
 Restrict the temporal number to the complement of the temporal box (internal function). More...
 
Datum tnumber_restrict_tbox (FunctionCallInfo fcinfo, bool atfunc)
 Restricts the temporal value to the (complement of the) temporal box. More...
 
PGDLLEXPORT Datum tnumber_at_tbox (PG_FUNCTION_ARGS)
 Restricts the temporal value to the temporal box. More...
 
PGDLLEXPORT Datum tnumber_minus_tbox (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the temporal box. More...
 
PGDLLEXPORT Datum temporal_intersects_timestamp (PG_FUNCTION_ARGS)
 Returns true if the temporal value intersects the timestamp. More...
 
PGDLLEXPORT Datum temporal_intersects_timestampset (PG_FUNCTION_ARGS)
 Returns true if the temporal value intersects the timestamp set. More...
 
PGDLLEXPORT Datum temporal_intersects_period (PG_FUNCTION_ARGS)
 Returns true if the temporal value intersects the period. More...
 
PGDLLEXPORT Datum temporal_intersects_periodset (PG_FUNCTION_ARGS)
 Returns true if the temporal value intersects the period set. More...
 
PGDLLEXPORT Datum tnumber_integral (PG_FUNCTION_ARGS)
 Returns the integral (area under the curve) of the temporal number value. More...
 
PGDLLEXPORT Datum tnumber_twavg (PG_FUNCTION_ARGS)
 Returns the time-weighted average of the temporal number. More...
 
static int temporal_cmp_internal (const Temporal *temp1, const Temporal *temp2)
 Returns -1, 0, or 1 depending on whether the first temporal value is less than, equal, or greater than the second one (internal function) More...
 
PGDLLEXPORT Datum temporal_cmp (PG_FUNCTION_ARGS)
 Returns -1, 0, or 1 depending on whether the first temporal value is less than, equal, or greater than the second temporal value. More...
 
static bool temporal_eq_internal (const Temporal *temp1, const Temporal *temp2)
 Returns true if the two temporal values are equal (internal function) More...
 
PGDLLEXPORT Datum temporal_eq (PG_FUNCTION_ARGS)
 Returns true if the two temporal values are equal. More...
 
bool temporal_ne_internal (Temporal *temp1, Temporal *temp2)
 Returns true if the two temporal values are different (internal function) More...
 
PGDLLEXPORT Datum temporal_ne (PG_FUNCTION_ARGS)
 Returns true if the two temporal values are different. More...
 
PGDLLEXPORT Datum temporal_lt (PG_FUNCTION_ARGS)
 Returns true if the first temporal value is less than the second one. More...
 
PGDLLEXPORT Datum temporal_le (PG_FUNCTION_ARGS)
 Returns true if the first temporal value is less than or equal to the second one. More...
 
PGDLLEXPORT Datum temporal_ge (PG_FUNCTION_ARGS)
 Returns true if the first temporal value is greater than or equal to the second one. More...
 
PGDLLEXPORT Datum temporal_gt (PG_FUNCTION_ARGS)
 Returns true if the first temporal value is greater than the second one. More...
 
uint32 temporal_hash_internal (const Temporal *temp)
 Returns the hash value of the temporal value (dispatch function) More...
 
PGDLLEXPORT Datum temporal_hash (PG_FUNCTION_ARGS)
 Returns the hash value of the temporal value. More...
 

Variables

 PG_MODULE_MAGIC
 
static char * tempsubtypeName []
 Array storing the string representation of the concrete subtypes of temporal types. More...
 
struct tempsubtype_struct tempsubtype_struct_array []
 Array storing the mapping between the string representation of the subtypes of the temporal types and the corresponding enum value. More...
 

Detailed Description

Basic functions for temporal types of any subtype.