MobilityDB  1.0
Data Structures | Macros | Typedefs | Enumerations | Functions
temporal.h File Reference

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

#include <postgres.h>
#include <catalog/pg_type.h>
#include <lib/stringinfo.h>
#include <utils/array.h>
#include <utils/rangetypes.h>
#include "timetypes.h"
#include "tbox.h"
#include "point/stbox.h"
Include dependency graph for temporal.h:

Go to the source code of this file.

Data Structures

struct  tempsubtype_struct
 Structure to represent the temporal subtype array. More...
 
struct  Temporal
 Structure to represent the common structure of temporal values of any temporal subtype. More...
 
struct  TInstant
 Structure to represent temporal values of instant subtype. More...
 
struct  TInstantSet
 Structure to represent temporal values of instant set subtype. More...
 
struct  TSequence
 Structure to represent temporal values of sequence subtype. More...
 
struct  TSequenceSet
 Structure to represent temporal values of sequence set subtype. More...
 
union  bboxunion
 Structure to represent all types of bounding boxes. More...
 
struct  double2
 Structure to represent values of the internal type for computing aggregates for temporal number types. More...
 
struct  double3
 Structure to represent values of the internal type for computing aggregates for 2D temporal point types. More...
 
struct  double4
 Structure to represent values of the internal type for computing aggregates for 3D temporal point types. More...
 
struct  CommonEntry
 Structure to represent information about an entry that can be placed to either group without affecting overlap over selected axis ("common entry"). More...
 
struct  SplitInterval
 Structure to represent a projection of bounding box to an axis. More...
 

Macros

#define MOBDB_EPSILON   1.0E-05
 Floating point precision. More...
 
#define DIST_EPSILON   1.0E-05
 Precision for distance operations. More...
 
#define DISCONTINUOUS   true
 Symbolic constants for lifting. More...
 
#define CONTINUOUS   false
 
#define INVERT   true
 Symbolic constants for lifting. More...
 
#define INVERT_NO   false
 
#define REST_AT   true
 Symbolic constants for the restriction functions. More...
 
#define REST_MINUS   false
 
#define UPPER_INC   true
 Symbolic constants for the restriction functions with boxes. More...
 
#define UPPER_EXC   false
 
#define EVER   true
 Symbolic constants for the ever/always functions. More...
 
#define ALWAYS   false
 
#define GET_MIN   true
 Symbolic constants for the restriction and the aggregation functions. More...
 
#define GET_MAX   false
 
#define CROSSINGS   true
 Symbolic constants for the synchronization and the aggregation functions. More...
 
#define CROSSINGS_NO   false
 
#define BBOX_TEST   true
 Symbolic constants for the synchronization and the aggregation functions. More...
 
#define BBOX_TEST_NO   false
 
#define MERGE   true
 Symbolic constants for the make functions. More...
 
#define MERGE_NO   false
 
#define NORMALIZE   true
 
#define NORMALIZE_NO   false
 
#define LINEAR   true
 
#define STEP   false
 
#define WITH_Z   true
 Symbolic constants for spatial relationships. More...
 
#define NO_Z   false
 
#define RANGE_ROUNDOFF   false
 
#define ANYTEMPSUBTYPE   0
 Enumeration for the concrete subtype of temporal types. More...
 
#define INSTANT   1
 
#define INSTANTSET   2
 
#define SEQUENCE   3
 
#define SEQUENCESET   4
 
#define TYPMOD_GET_SUBTYPE(typmod)   ((int16) ((typmod == -1) ? (0) : (typmod & 0x0000000F)))
 
#define TEMPSUBTYPE_STRUCT_ARRAY_LEN   (sizeof tempsubtype_struct_array/sizeof(struct tempsubtype_struct))
 
#define TEMPSUBTYPE_MAX_LEN   13
 
#define MOBDB_FLAGS_GET_BYVAL(flags)   ((bool) ((flags) & 0x01))
 
#define MOBDB_FLAGS_GET_CONTINUOUS(flags)   ((bool) (((flags) & 0x02)>>1))
 
#define MOBDB_FLAGS_GET_LINEAR(flags)   ((bool) (((flags) & 0x04)>>2))
 
#define MOBDB_FLAGS_GET_X(flags)   ((bool) (((flags) & 0x08)>>3))
 
#define MOBDB_FLAGS_GET_Z(flags)   ((bool) (((flags) & 0x10)>>4))
 
#define MOBDB_FLAGS_GET_T(flags)   ((bool) (((flags) & 0x20)>>5))
 
#define MOBDB_FLAGS_GET_GEODETIC(flags)   ((bool) (((flags) & 0x40)>>6))
 
#define MOBDB_FLAGS_SET_BYVAL(flags, value)   ((flags) = (value) ? ((flags) | 0x01) : ((flags) & 0xFE))
 
#define MOBDB_FLAGS_SET_CONTINUOUS(flags, value)   ((flags) = (value) ? ((flags) | 0x02) : ((flags) & 0xFD))
 
#define MOBDB_FLAGS_SET_LINEAR(flags, value)   ((flags) = (value) ? ((flags) | 0x04) : ((flags) & 0xFB))
 
#define MOBDB_FLAGS_SET_X(flags, value)   ((flags) = (value) ? ((flags) | 0x08) : ((flags) & 0xF7))
 
#define MOBDB_FLAGS_SET_Z(flags, value)   ((flags) = (value) ? ((flags) | 0x10) : ((flags) & 0xEF))
 
#define MOBDB_FLAGS_SET_T(flags, value)   ((flags) = (value) ? ((flags) | 0x20) : ((flags) & 0xDF))
 
#define MOBDB_FLAGS_SET_GEODETIC(flags, value)   ((flags) = (value) ? ((flags) | 0x40) : ((flags) & 0xBF))
 
#define JAN_3_2000   (2 * USECS_PER_DAY)
 
#define DEFAULT_TIME_ORIGIN   (JAN_3_2000)
 
#define DEFAULT_FLOATRANGE_ORIGIN   (0.0)
 
#define DEFAULT_INTRANGE_ORIGIN   (0)
 
#define LIMIT_RATIO   0.3
 
#define FLOAT8_EQ(a, b)   (float8_cmp_internal(a, b) == 0)
 
#define FLOAT8_LT(a, b)   (float8_cmp_internal(a, b) < 0)
 
#define FLOAT8_LE(a, b)   (float8_cmp_internal(a, b) <= 0)
 
#define FLOAT8_GT(a, b)   (float8_cmp_internal(a, b) > 0)
 
#define FLOAT8_GE(a, b)   (float8_cmp_internal(a, b) >= 0)
 
#define FLOAT8_MAX(a, b)   (FLOAT8_GT(a, b) ? (a) : (b))
 
#define FLOAT8_MIN(a, b)   (FLOAT8_LT(a, b) ? (a) : (b))
 
#define RTOverBeforeStrategyNumber   28 /* for &<# */
 
#define RTBeforeStrategyNumber   29 /* for <<# */
 
#define RTAfterStrategyNumber   30 /* for #>> */
 
#define RTOverAfterStrategyNumber   31 /* for #&> */
 
#define RTOverFrontStrategyNumber   32 /* for &</ */
 
#define RTFrontStrategyNumber   33 /* for <</ */
 
#define RTBackStrategyNumber   34 /* for />> */
 
#define RTOverBackStrategyNumber   35 /* for /&> */
 
#define DatumGetDouble2P(X)   ((double2 *) DatumGetPointer(X))
 
#define Double2PGetDatum(X)   PointerGetDatum(X)
 
#define DatumGetDouble3P(X)   ((double3 *) DatumGetPointer(X))
 
#define Double3PGetDatum(X)   PointerGetDatum(X)
 
#define DatumGetDouble4P(X)   ((double4 *) DatumGetPointer(X))
 
#define Double4PGetDatum(X)   PointerGetDatum(X)
 
#define DatumGetTemporal(X)   ((Temporal *) PG_DETOAST_DATUM(X))
 
#define DatumGetTInstant(X)   ((TInstant *) PG_DETOAST_DATUM(X))
 
#define DatumGetTInstantSet(X)   ((TInstantSet *) PG_DETOAST_DATUM(X))
 
#define DatumGetTSequence(X)   ((TSequence *) PG_DETOAST_DATUM(X))
 
#define DatumGetTSequenceSet(X)   ((TSequenceSet *) PG_DETOAST_DATUM(X))
 
#define PG_GETARG_TEMPORAL(X)   ((Temporal *) PG_GETARG_VARLENA_P(X))
 
#define PG_GETARG_ANYDATUM(X)
 
#define DATUM_FREE(value, basetypid)
 
#define DATUM_FREE_IF_COPY(value, basetypid, n)
 
#define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori)
 

Typedefs

typedef union bboxunion bboxunion
 Structure to represent all types of bounding boxes. More...
 
typedef int(* qsort_comparator) (const void *a, const void *b)
 
typedef Datum(* varfunc) (Datum,...)
 
typedef Datum(* datum_func2) (Datum, Datum)
 
typedef Datum(* datum_func3) (Datum, Datum, Datum)
 

Enumerations

enum  TIntersection { SYNCHRONIZE_NOCROSS, SYNCHRONIZE_CROSS }
 Enumeration for the intersection/synchronization functions. More...
 

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...
 
void ensure_valid_tempsubtype (int16 type)
 Ensures that the temporal type is valid. More...
 
void ensure_valid_tempsubtype_all (int16 type)
 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_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 strict)
 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...
 
Temporalpg_getarg_temporal (const Temporal *temp)
 
bool intersection_temporal_temporal (const Temporal *temp1, const Temporal *temp2, TIntersection mode, Temporal **inter1, Temporal **inter2)
 Temporally intersect the two temporal values. More...
 
Datum mobilitydb_version (PG_FUNCTION_ARGS)
 Version of the MobilityDB extension. More...
 
Datum mobilitydb_full_version (PG_FUNCTION_ARGS)
 Versions of the MobilityDB extension and its dependencies. More...
 
Datum temporal_in (PG_FUNCTION_ARGS)
 Generic input function for temporal types. More...
 
Datum temporal_out (PG_FUNCTION_ARGS)
 Generic output function for temporal types. More...
 
Datum temporal_send (PG_FUNCTION_ARGS)
 
Datum temporal_recv (PG_FUNCTION_ARGS)
 Generic receive function for temporal types. More...
 
Temporaltemporal_read (StringInfo buf, Oid basetypid)
 Returns a new temporal value from its binary representation read from the buffer (dispatch function) More...
 
void temporal_write (const Temporal *temp, StringInfo buf)
 Write the binary representation of the temporal value into the buffer (dispatch function) More...
 
Datum tinstant_constructor (PG_FUNCTION_ARGS)
 Construct a temporal instant value from the arguments. More...
 
Datum tinstantset_constructor (PG_FUNCTION_ARGS)
 Construct a temporal instant set value from the array of temporal instant values. More...
 
Datum tlinearseq_constructor (PG_FUNCTION_ARGS)
 Construct a temporal sequence value with linear or stepwise interpolation from the array of temporal instant values. More...
 
Datum tstepseq_constructor (PG_FUNCTION_ARGS)
 Construct a temporal sequence value with stepwise interpolation from the array of temporal instant values. More...
 
Datum tsequenceset_constructor (PG_FUNCTION_ARGS)
 Construct a temporal sequence set value from the array of temporal sequence values. More...
 
Datum temporal_append_tinstant (PG_FUNCTION_ARGS)
 Append an instant to the end of a temporal value. More...
 
Datum temporal_merge (PG_FUNCTION_ARGS)
 Merge the two temporal values. More...
 
Datum temporal_merge_array (PG_FUNCTION_ARGS)
 Merge the array of temporal values. More...
 
Temporaltemporal_merge_internal (const Temporal *temp1, const Temporal *temp2)
 
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...
 
Datum tint_to_tfloat (PG_FUNCTION_ARGS)
 Cast the temporal integer value as a temporal float value. More...
 
Datum temporal_to_period (PG_FUNCTION_ARGS)
 Returns the bounding period on which the temporal value is defined. More...
 
Temporaltint_to_tfloat_internal (Temporal *temp)
 Cast the temporal integer value as a temporal float value (dispatch function) 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...
 
Datum temporal_mem_size (PG_FUNCTION_ARGS)
 Returns the size in bytes of the temporal value. More...
 
Datum temporal_get_values (PG_FUNCTION_ARGS)
 Returns the base values of the temporal value as an array. More...
 
Datum temporal_get_time (PG_FUNCTION_ARGS)
 Returns the time on which the temporal value is defined as a period set. More...
 
Datum tinstant_get_value (PG_FUNCTION_ARGS)
 Returns the base value of the temporal instant value. More...
 
Datum tnumber_to_tbox (PG_FUNCTION_ARGS)
 Returns the bounding box of the temporal value. More...
 
Datum tnumber_value_range (PG_FUNCTION_ARGS)
 Returns the value range of the temporal integer value. More...
 
Datum temporal_start_value (PG_FUNCTION_ARGS)
 Returns the start base value of the temporal value. More...
 
Datum temporal_end_value (PG_FUNCTION_ARGS)
 Returns the end base value of the temporal value. More...
 
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...
 
Datum temporal_num_instants (PG_FUNCTION_ARGS)
 Returns the number of distinct instants of the temporal value. More...
 
Datum temporal_start_instant (PG_FUNCTION_ARGS)
 Returns the start instant of the temporal value. More...
 
Datum temporal_end_instant (PG_FUNCTION_ARGS)
 Returns the end instant of the temporal value. More...
 
Datum temporal_instant_n (PG_FUNCTION_ARGS)
 Returns the n-th instant of the temporal value. More...
 
Datum temporal_instants (PG_FUNCTION_ARGS)
 Returns the distinct instants of the temporal value as an array. More...
 
Datum temporal_num_timestamps (PG_FUNCTION_ARGS)
 Returns the number of distinct timestamps of the temporal value. More...
 
Datum temporal_start_timestamp (PG_FUNCTION_ARGS)
 Returns the start timestamp of the temporal value. More...
 
Datum temporal_end_timestamp (PG_FUNCTION_ARGS)
 Returns the end timestamp of the temporal value. More...
 
Datum temporal_timestamp_n (PG_FUNCTION_ARGS)
 Returns the n-th distinct timestamp of the temporal value. More...
 
Datum temporal_timestamps (PG_FUNCTION_ARGS)
 Returns the distinct timestamps of the temporal value as an array. More...
 
Datum temporal_shift (PG_FUNCTION_ARGS)
 Shift the time span of the temporal value by the interval. More...
 
ArrayType * temporal_timestamps_internal (const Temporal *temp)
 Returns the distinct timestamps of the temporal value as an array. More...
 
const TInstant ** temporal_instants_internal (const Temporal *temp, int *count)
 Returns the instants of the temporal value as a C array. 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...
 
PeriodSettemporal_get_time_internal (const Temporal *temp)
 Returns the time on which the temporal value is defined as a period set (dispatch function) More...
 
Datum tfloat_ranges (const Temporal *temp)
 Returns the base values of the temporal float value as an array of ranges (dispatch function) 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...
 
const TInstanttemporal_end_instant_internal (const Temporal *temp)
 Returns the end instant of the temporal value (internal function). More...
 
TimestampTz temporal_start_timestamp_internal (const Temporal *temp)
 Returns the start timestamp of the temporal value (dispatch function) More...
 
RangeType * tnumber_value_range_internal (const Temporal *temp)
 Returns the value range of the temporal integer value (internal function) More...
 
Datum temporal_ever_eq (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever equal to the base value. More...
 
Datum temporal_ever_ne (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever different from the base value. More...
 
Datum temporal_ever_lt (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever less than the base value. More...
 
Datum temporal_ever_le (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever less than or equal to the base value. More...
 
Datum temporal_ever_gt (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever greater than the base value. More...
 
Datum temporal_ever_ge (PG_FUNCTION_ARGS)
 Returns true if the temporal value is ever greater than or equal to the base value. More...
 
Datum temporal_always_eq (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always equal to the base value. More...
 
Datum temporal_always_ne (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always different from the base value. More...
 
Datum temporal_always_lt (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always less than the base value. More...
 
Datum temporal_always_le (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always less than or equal to the base value. More...
 
Datum temporal_always_gt (PG_FUNCTION_ARGS)
 Returns true if the temporal value is always greater than the base value. More...
 
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_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...
 
Datum temporal_at_value (PG_FUNCTION_ARGS)
 Restricts the temporal value to the base value. More...
 
Datum temporal_minus_value (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the base value. More...
 
Datum temporal_at_values (PG_FUNCTION_ARGS)
 Restricts the temporal value to the array of base values. More...
 
Datum tnumber_at_range (PG_FUNCTION_ARGS)
 Restricts the temporal value to the range of base values. More...
 
Datum tnumber_minus_range (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the range of base values. More...
 
Datum tnumber_at_ranges (PG_FUNCTION_ARGS)
 Restricts the temporal value to the array of ranges of base values. More...
 
Datum tnumber_minus_ranges (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the array of ranges of base values. More...
 
Datum temporal_at_min (PG_FUNCTION_ARGS)
 Restricts the temporal value to the minimum base value. More...
 
Datum temporal_minus_min (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the minimum base value. More...
 
Datum temporal_at_max (PG_FUNCTION_ARGS)
 Restricts the temporal value to the maximum base value. More...
 
Datum temporal_minus_max (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the maximum base value. More...
 
Datum temporal_at_timestamp (PG_FUNCTION_ARGS)
 Restricts the temporal value to the timestamp. More...
 
Datum temporal_minus_timestamp (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the timestamp. More...
 
Datum temporal_value_at_timestamp (PG_FUNCTION_ARGS)
 Returns the base value of the temporal value at the timestamp. More...
 
Datum temporal_at_timestampset (PG_FUNCTION_ARGS)
 Restricts the temporal value to the timestamp set. More...
 
Datum temporal_minus_timestampset (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the timestamp set. More...
 
Datum temporal_at_period (PG_FUNCTION_ARGS)
 Restricts the temporal value to the period. More...
 
Datum temporal_minus_period (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the period. More...
 
Datum temporal_at_periodset (PG_FUNCTION_ARGS)
 Restricts the temporal value to the period set. More...
 
Datum temporal_minus_periodset (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the period set. More...
 
Datum temporal_intersects_timestamp (PG_FUNCTION_ARGS)
 Returns true if the temporal value intersects the timestamp. More...
 
Datum temporal_intersects_timestampset (PG_FUNCTION_ARGS)
 Returns true if the temporal value intersects the timestamp set. More...
 
Datum temporal_intersects_period (PG_FUNCTION_ARGS)
 Returns true if the temporal value intersects the period. More...
 
Datum temporal_intersects_periodset (PG_FUNCTION_ARGS)
 Returns true if the temporal value intersects the period set. 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...
 
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...
 
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...
 
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...
 
Temporaltemporal_restrict_timestamp_internal (const Temporal *temp, TimestampTz t, bool atfunc)
 Restricts the temporal value to the timestamp (dispatch function) More...
 
Temporaltemporal_at_period_internal (const Temporal *temp, const Period *ps)
 
Temporaltemporal_minus_period_internal (const Temporal *temp, const Period *ps)
 
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...
 
void temporal_period (Period *p, const Temporal *temp)
 Returns the bounding period on which the temporal value is defined (dispatch function) More...
 
char * temporal_to_string (const Temporal *temp, char *(*value_out)(Oid, Datum))
 Returns the string representation of the temporal value (dispatch function) 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...
 
Datum temporal_lt (PG_FUNCTION_ARGS)
 Returns true if the first temporal value is less than the second one. More...
 
Datum temporal_le (PG_FUNCTION_ARGS)
 Returns true if the first temporal value is less than or equal to the second one. More...
 
Datum temporal_eq (PG_FUNCTION_ARGS)
 Returns true if the two temporal values are equal. More...
 
Datum temporal_ge (PG_FUNCTION_ARGS)
 Returns true if the first temporal value is greater than or equal to the second one. More...
 
Datum temporal_gt (PG_FUNCTION_ARGS)
 Returns true if the first temporal value is greater than the second one. More...
 
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...
 
Datum temporal_hash (PG_FUNCTION_ARGS)
 Returns the hash value of the temporal value. More...
 
uint32 temporal_hash_internal (const Temporal *temp)
 Returns the hash value of the temporal value (dispatch function) More...
 

Detailed Description

Basic functions for temporal types of any subtype.