36 #ifndef __TEMPORAL_H__ 37 #define __TEMPORAL_H__ 40 #include <catalog/pg_type.h> 41 #include <lib/stringinfo.h> 42 #include <utils/array.h> 43 #include <utils/rangetypes.h> 49 #if POSTGRESQL_VERSION_NUMBER < 130000 50 #ifndef USE_FLOAT4_BYVAL 51 #error Postgres needs to be configured with USE_FLOAT4_BYVAL 55 #ifndef USE_FLOAT8_BYVAL 56 #error Postgres needs to be configured with USE_FLOAT8_BYVAL 62 #define MOBDB_EPSILON 1.0E-05 66 #define DIST_EPSILON 1.0E-05 69 #define DISCONTINUOUS true 70 #define CONTINUOUS false 74 #define INVERT_NO false 78 #define REST_MINUS false 81 #define UPPER_INC true 82 #define UPPER_EXC false 93 #define CROSSINGS true 94 #define CROSSINGS_NO false 97 #define BBOX_TEST true 98 #define BBOX_TEST_NO false 102 #define MERGE_NO false 104 #define NORMALIZE true 105 #define NORMALIZE_NO false 116 #define RANGE_ROUNDOFF false 132 #define ANYTEMPSUBTYPE 0 136 #define SEQUENCESET 4 138 #define TYPMOD_GET_SUBTYPE(typmod) ((int16) ((typmod == -1) ? (0) : (typmod & 0x0000000F))) 149 #define TEMPSUBTYPE_STRUCT_ARRAY_LEN \ 150 (sizeof tempsubtype_struct_array/sizeof(struct tempsubtype_struct)) 151 #define TEMPSUBTYPE_MAX_LEN 13 165 #define MOBDB_FLAGS_GET_BYVAL(flags) ((bool) ((flags) & 0x01)) 166 #define MOBDB_FLAGS_GET_CONTINUOUS(flags) ((bool) (((flags) & 0x02)>>1)) 167 #define MOBDB_FLAGS_GET_LINEAR(flags) ((bool) (((flags) & 0x04)>>2)) 168 #define MOBDB_FLAGS_GET_X(flags) ((bool) (((flags) & 0x08)>>3)) 169 #define MOBDB_FLAGS_GET_Z(flags) ((bool) (((flags) & 0x10)>>4)) 170 #define MOBDB_FLAGS_GET_T(flags) ((bool) (((flags) & 0x20)>>5)) 171 #define MOBDB_FLAGS_GET_GEODETIC(flags) ((bool) (((flags) & 0x40)>>6)) 174 #define MOBDB_FLAGS_SET_BYVAL(flags, value) \ 175 ((flags) = (value) ? ((flags) | 0x01) : ((flags) & 0xFE)) 176 #define MOBDB_FLAGS_SET_CONTINUOUS(flags, value) \ 177 ((flags) = (value) ? ((flags) | 0x02) : ((flags) & 0xFD)) 178 #define MOBDB_FLAGS_SET_LINEAR(flags, value) \ 179 ((flags) = (value) ? ((flags) | 0x04) : ((flags) & 0xFB)) 180 #define MOBDB_FLAGS_SET_X(flags, value) \ 181 ((flags) = (value) ? ((flags) | 0x08) : ((flags) & 0xF7)) 182 #define MOBDB_FLAGS_SET_Z(flags, value) \ 183 ((flags) = (value) ? ((flags) | 0x10) : ((flags) & 0xEF)) 184 #define MOBDB_FLAGS_SET_T(flags, value) \ 185 ((flags) = (value) ? ((flags) | 0x20) : ((flags) & 0xDF)) 186 #define MOBDB_FLAGS_SET_GEODETIC(flags, value) \ 187 ((flags) = (value) ? ((flags) | 0x40) : ((flags) & 0xBF)) 198 #define JAN_3_2000 (2 * USECS_PER_DAY) 199 #define DEFAULT_TIME_ORIGIN (JAN_3_2000) 200 #define DEFAULT_FLOATRANGE_ORIGIN (0.0) 201 #define DEFAULT_INTRANGE_ORIGIN (0) 208 #define LIMIT_RATIO 0.3 211 #define FLOAT8_EQ(a,b) (float8_cmp_internal(a, b) == 0) 212 #define FLOAT8_LT(a,b) (float8_cmp_internal(a, b) < 0) 213 #define FLOAT8_LE(a,b) (float8_cmp_internal(a, b) <= 0) 214 #define FLOAT8_GT(a,b) (float8_cmp_internal(a, b) > 0) 215 #define FLOAT8_GE(a,b) (float8_cmp_internal(a, b) >= 0) 216 #define FLOAT8_MAX(a,b) (FLOAT8_GT(a, b) ? (a) : (b)) 217 #define FLOAT8_MIN(a,b) (FLOAT8_LT(a, b) ? (a) : (b)) 224 #define RTOverBeforeStrategyNumber 28 225 #define RTBeforeStrategyNumber 29 226 #define RTAfterStrategyNumber 30 227 #define RTOverAfterStrategyNumber 31 228 #define RTOverFrontStrategyNumber 32 229 #define RTFrontStrategyNumber 33 230 #define RTBackStrategyNumber 34 231 #define RTOverBackStrategyNumber 35 392 #define DatumGetDouble2P(X) ((double2 *) DatumGetPointer(X)) 393 #define Double2PGetDatum(X) PointerGetDatum(X) 394 #define DatumGetDouble3P(X) ((double3 *) DatumGetPointer(X)) 395 #define Double3PGetDatum(X) PointerGetDatum(X) 396 #define DatumGetDouble4P(X) ((double4 *) DatumGetPointer(X)) 397 #define Double4PGetDatum(X) PointerGetDatum(X) 401 #define DatumGetTemporal(X) ((Temporal *) PG_DETOAST_DATUM(X)) 402 #define DatumGetTInstant(X) ((TInstant *) PG_DETOAST_DATUM(X)) 403 #define DatumGetTInstantSet(X) ((TInstantSet *) PG_DETOAST_DATUM(X)) 404 #define DatumGetTSequence(X) ((TSequence *) PG_DETOAST_DATUM(X)) 405 #define DatumGetTSequenceSet(X) ((TSequenceSet *) PG_DETOAST_DATUM(X)) 407 #define PG_GETARG_TEMPORAL(X) ((Temporal *) PG_GETARG_VARLENA_P(X)) 409 #define PG_GETARG_ANYDATUM(X) (get_typlen(get_fn_expr_argtype(fcinfo->flinfo, X)) == -1 ? \ 410 PointerGetDatum(PG_GETARG_VARLENA_P(X)) : PG_GETARG_DATUM(X)) 412 #define DATUM_FREE(value, basetypid) \ 414 if (! base_type_byvalue(basetypid)) \ 415 pfree(DatumGetPointer(value)); \ 418 #define DATUM_FREE_IF_COPY(value, basetypid, n) \ 420 if (! base_type_byvalue(basetypid) && DatumGetPointer(value) != PG_GETARG_POINTER(n)) \ 421 pfree(DatumGetPointer(value)); \ 430 #ifndef POSTGIS_FREE_IF_COPY_P 431 #define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori) \ 433 if ((Pointer) (ptrsrc) != (Pointer) (ptrori)) \ 461 const TInstant *inst2,
bool strict);
509 Oid basetypid,
bool linear);
607 TimestampTz t, Datum *value);
611 const Datum *values,
int count,
int *newcount);
613 RangeType **ranges,
int count,
int *newcount);
615 RangeType *range,
bool atfunc);
618 TimestampTz t,
bool atfunc);
628 char *(*value_out)(Oid, Datum));
Datum tinstantset_constructor(PG_FUNCTION_ARGS)
Construct a temporal instant set value from the array of temporal instant values. ...
Definition: temporal.c:834
int32 count
number of TInstant elements
Definition: temporal.h:272
Datum temporal_ever_eq(PG_FUNCTION_ARGS)
Returns true if the temporal value is ever equal to the base value.
Definition: temporal.c:2845
Datum temporal_get_time(PG_FUNCTION_ARGS)
Returns the time on which the temporal value is defined as a period set.
Definition: temporal.c:1748
Datum temporal_at_periodset(PG_FUNCTION_ARGS)
Restricts the temporal value to the period set.
Definition: temporal.c:3860
const TInstant ** temporal_instants_internal(const Temporal *temp, int *count)
Returns the instants of the temporal value as a C array.
Definition: temporal.c:2345
int32 vl_len_
varlena header (do not touch directly!)
Definition: temporal.h:295
double a
Definition: temporal.h:320
Datum temporal_timestamps(PG_FUNCTION_ARGS)
Returns the distinct timestamps of the temporal value as an array.
Definition: temporal.c:2527
Structure to represent periods.
Definition: timetypes.h:52
Datum mobilitydb_version(PG_FUNCTION_ARGS)
Version of the MobilityDB extension.
Definition: temporal.c:568
void ensure_valid_duration(const Interval *duration)
Ensures that the interval is a positive and absolute duration.
Definition: temporal.c:416
Datum temporal_ever_ge(PG_FUNCTION_ARGS)
Returns true if the temporal value is ever greater than or equal to the base value.
Definition: temporal.c:2948
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...
Definition: temporal.c:3109
Datum temporal_intersects_period(PG_FUNCTION_ARGS)
Returns true if the temporal value intersects the period.
Definition: temporal.c:4058
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 temp...
Definition: temporal.c:369
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...
Definition: temporal.c:3017
const TInstant * temporal_min_instant(const Temporal *temp)
Returns a pointer to the instant with minimum base value of the temporal value.
Definition: temporal.c:1943
Datum temporal_at_min(PG_FUNCTION_ARGS)
Restricts the temporal value to the minimum base value.
Definition: temporal.c:3547
Datum temporal_intersects_timestamp(PG_FUNCTION_ARGS)
Returns true if the temporal value intersects the timestamp.
Definition: temporal.c:4011
Datum temporal_end_instant(PG_FUNCTION_ARGS)
Returns the end instant of the temporal value.
Definition: temporal.c:2275
RangeType * tnumber_value_range_internal(const Temporal *temp)
Returns the value range of the temporal integer value (internal function)
Definition: temporal.c:1833
Datum temporal_le(PG_FUNCTION_ARGS)
Returns true if the first temporal value is less than or equal to the second one. ...
Definition: temporal.c:4419
Definition: temporal.h:121
TIntersection
Enumeration for the intersection/synchronization functions.
Definition: temporal.h:119
Datum temporal_mem_size(PG_FUNCTION_ARGS)
Returns the size in bytes of the temporal value.
Definition: temporal.c:1622
void ensure_seq_subtypes(int16 subtype)
Ensures that the temporal type is a sequence (set)
Definition: temporal.c:235
Datum temporal_at_values(PG_FUNCTION_ARGS)
Restricts the temporal value to the array of base values.
Definition: temporal.c:3308
int16 subtype
subtype
Definition: temporal.h:269
Datum tnumber_minus_range(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the range of base values.
Definition: temporal.c:3394
double c
Definition: temporal.h:332
Datum temporal_shift(PG_FUNCTION_ARGS)
Shift the time span of the temporal value by the interval.
Definition: temporal.c:2574
Structure to represent a projection of bounding box to an axis.
Definition: temporal.h:380
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: temporal.h:241
uint32 temporal_hash_internal(const Temporal *temp)
Returns the hash value of the temporal value (dispatch function)
Definition: temporal.c:4478
Datum temporal_gt(PG_FUNCTION_ARGS)
Returns true if the first temporal value is greater than the second one.
Definition: temporal.c:4456
Period period
time span (24 bytes)
Definition: temporal.h:286
void ensure_same_interpolation(const Temporal *temp1, const Temporal *temp2)
Ensures that the two temporal values have the same interpolation.
Definition: temporal.c:302
void ensure_non_empty_array(ArrayType *array)
Ensures that the array is not empty.
Definition: temporal.c:441
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 ...
Definition: temporal.c:2667
void ensure_linear_interpolation(int16 flags)
Ensure that the temporal value has linear interpolation.
Definition: temporal.c:265
int16 flags
flags
Definition: temporal.h:283
int32 vl_len_
varlena header (do not touch directly!)
Definition: temporal.h:255
bool temporal_bbox_restrict_value(const Temporal *temp, Datum value)
Returns true if the bounding box of the temporal value contains the base value.
Definition: temporal.c:2972
TimestampTz t
timestamp (8 bytes)
Definition: temporal.h:259
Temporal * temporal_minus_period_internal(const Temporal *temp, const Period *ps)
int32 count
number of TInstant elements
Definition: temporal.h:285
Structure to represent spatiotemporal boxes.
Definition: stbox.h:51
Datum temporal_merge(PG_FUNCTION_ARGS)
Merge the two temporal values.
Definition: temporal.c:1102
Datum temporal_interpolation(PG_FUNCTION_ARGS)
Returns the string representation of the temporal interpolation.
Definition: temporal.c:1597
Datum temporal_start_instant(PG_FUNCTION_ARGS)
Returns the start instant of the temporal value.
Definition: temporal.c:2225
Datum temporal_num_instants(PG_FUNCTION_ARGS)
Returns the number of distinct instants of the temporal value.
Definition: temporal.c:2203
Datum temporal_hash(PG_FUNCTION_ARGS)
Returns the hash value of the temporal value.
Definition: temporal.c:4498
int32 totalcount
total number of TInstant elements in all TSequence elements
Definition: temporal.h:300
Datum temporal_intersects_timestampset(PG_FUNCTION_ARGS)
Returns true if the temporal value intersects the timestamp set.
Definition: temporal.c:4034
double a
Definition: temporal.h:330
int16 subtype
subtype
Definition: temporal.h:282
double b
Definition: temporal.h:321
Structure to represent the temporal subtype array.
Definition: temporal.h:143
Oid basetypid
base type's OID (4 bytes)
Definition: temporal.h:246
Datum temporal_always_gt(PG_FUNCTION_ARGS)
Returns true if the temporal value is always greater than the base value.
Definition: temporal.c:2937
Datum temporal_append_tinstant(PG_FUNCTION_ARGS)
Append an instant to the end of a temporal value.
Definition: temporal.c:937
bool intersection_temporal_temporal(const Temporal *temp1, const Temporal *temp2, TIntersection mode, Temporal **inter1, Temporal **inter2)
Temporally intersect the two temporal values.
Definition: temporal.c:473
Temporal * temporal_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) ...
Definition: temporal.c:1233
Temporal * temporal_merge_internal(const Temporal *temp1, const Temporal *temp2)
Definition: temporal.c:1054
Temporal * pg_getarg_temporal(const Temporal *temp)
Structure to represent values of the internal type for computing aggregates for temporal number types...
Definition: temporal.h:318
Datum temporal_recv(PG_FUNCTION_ARGS)
Generic receive function for temporal types.
Definition: temporal.c:726
int16 flags
flags
Definition: temporal.h:297
Temporal * temporal_at_period_internal(const Temporal *temp, const Period *ps)
Definition: temporal.c:3774
bool tempsubtype_from_string(const char *str, int16 *subtype)
Returns the enum value corresponding to the string representation of the concrete subtype of the temp...
Definition: temporal.c:132
Datum temporal_start_value(PG_FUNCTION_ARGS)
Returns the start base value of the temporal value.
Definition: temporal.c:1884
double upper
Definition: temporal.h:382
Oid basetypid
base type's OID (4 bytes)
Definition: temporal.h:271
Datum mobilitydb_full_version(PG_FUNCTION_ARGS)
Versions of the MobilityDB extension and its dependencies.
Definition: temporal.c:580
int16 flags
flags
Definition: temporal.h:257
int32 vl_len_
varlena header (do not touch directly!)
Definition: temporal.h:281
Datum tnumber_at_ranges(PG_FUNCTION_ARGS)
Restricts the temporal value to the array of ranges of base values.
Definition: temporal.c:3487
STBOX g
Definition: temporal.h:311
Datum temporal_max_value(PG_FUNCTION_ARGS)
Returns the maximum base value of the temporal value.
Definition: temporal.c:1999
Datum temporal_at_value(PG_FUNCTION_ARGS)
Restricts the temporal value to the base value.
Definition: temporal.c:3205
double a
Definition: temporal.h:341
Datum tsequenceset_constructor(PG_FUNCTION_ARGS)
Construct a temporal sequence set value from the array of temporal sequence values.
Definition: temporal.c:898
Datum temporal_intersects_periodset(PG_FUNCTION_ARGS)
Returns true if the temporal value intersects the period set.
Definition: temporal.c:4081
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 exclusi...
Definition: temporal.c:3651
Datum temporal_send(PG_FUNCTION_ARGS)
Definition: temporal.c:687
void * temporal_bbox_ptr(const Temporal *temp)
Returns a pointer to the precomputed bounding box of the temporal value.
Definition: temporal.c:1780
Structure to represent period sets.
Definition: timetypes.h:84
Period p
Definition: temporal.h:309
Temporal * temporal_restrict_periodset_internal(const Temporal *temp, const PeriodSet *ps, bool atfunc)
Restricts the temporal value to the (complement of the) period set (dispatch function) ...
Definition: temporal.c:3819
Datum temporal_end_timestamp(PG_FUNCTION_ARGS)
Returns the end timestamp of the temporal value.
Definition: temporal.c:2420
Datum temporal_at_timestampset(PG_FUNCTION_ARGS)
Restricts the temporal value to the timestamp set.
Definition: temporal.c:3730
Datum tnumber_at_range(PG_FUNCTION_ARGS)
Restricts the temporal value to the range of base values.
Definition: temporal.c:3384
int32 vl_len_
varlena header (do not touch directly!)
Definition: temporal.h:268
Datum tstepseq_constructor(PG_FUNCTION_ARGS)
Construct a temporal sequence value with stepwise interpolation from the array of temporal instant va...
Definition: temporal.c:876
Oid basetypid
base type's OID (4 bytes)
Definition: temporal.h:298
Datum tnumber_value_range(PG_FUNCTION_ARGS)
Returns the value range of the temporal integer value.
Definition: temporal.c:1867
Datum temporal_ever_gt(PG_FUNCTION_ARGS)
Returns true if the temporal value is ever greater than the base value.
Definition: temporal.c:2927
Datum temporal_always_le(PG_FUNCTION_ARGS)
Returns true if the temporal value is always less than or equal to the base value.
Definition: temporal.c:2917
Structure to represent temporal boxes.
Definition: tbox.h:53
Datum temporal_num_timestamps(PG_FUNCTION_ARGS)
Returns the number of distinct timestamps of the temporal value.
Definition: temporal.c:2442
Datum temporal_subtype(PG_FUNCTION_ARGS)
Returns the string representation of the temporal type.
Definition: temporal.c:1575
void _PG_init(void)
Initialize the extension.
Definition: temporal.c:81
ArrayType * temporal_timestamps_internal(const Temporal *temp)
Returns the distinct timestamps of the temporal value as an array.
Definition: temporal.c:2507
Datum temporal_instants(PG_FUNCTION_ARGS)
Returns the distinct instants of the temporal value as an array.
Definition: temporal.c:2365
Structure to represent all types of bounding boxes.
Definition: temporal.h:307
Datum temporal_at_max(PG_FUNCTION_ARGS)
Restricts the temporal value to the maximum base value.
Definition: temporal.c:3567
int16 flags
flags
Definition: temporal.h:245
int16 flags
flags
Definition: temporal.h:270
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.
Definition: temporal.c:4237
Datum temporal_lt(PG_FUNCTION_ARGS)
Returns true if the first temporal value is less than the second one.
Definition: temporal.c:4400
Datum temporal_minus_value(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the base value.
Definition: temporal.c:3215
Datum temporal_ever_le(PG_FUNCTION_ARGS)
Returns true if the temporal value is ever less than or equal to the base value.
Definition: temporal.c:2907
Datum temporal_get_values(PG_FUNCTION_ARGS)
Returns the base values of the temporal value as an array.
Definition: temporal.c:1663
Datum temporal_out(PG_FUNCTION_ARGS)
Generic output function for temporal types.
Definition: temporal.c:651
Datum temporal_minus_period(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the period.
Definition: temporal.c:3807
Functions for time types based on TimestampTz, that is, TimestampSet, Period, and PeriodSet...
Temporal * tnumber_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) ...
Definition: temporal.c:3330
TBOX b
Definition: temporal.h:310
Datum temporal_value_at_timestamp(PG_FUNCTION_ARGS)
Returns the base value of the temporal value at the timestamp.
Definition: temporal.c:3673
TimestampTz temporal_start_timestamp_internal(const Temporal *temp)
Returns the start timestamp of the temporal value (dispatch function)
Definition: temporal.c:2387
Datum tinstant_constructor(PG_FUNCTION_ARGS)
Construct a temporal instant value from the arguments.
Definition: temporal.c:819
Datum temporal_ever_lt(PG_FUNCTION_ARGS)
Returns true if the temporal value is ever less than the base value.
Definition: temporal.c:2887
Structure to represent temporal values of sequence set subtype.
Definition: temporal.h:293
int(* qsort_comparator)(const void *a, const void *b)
Definition: temporal.h:352
Datum temporal_min_value_internal(const Temporal *temp)
Returns the minimum base value of the temporal value (dispatch function)
Definition: temporal.c:1963
Functions for temporal bounding boxes.
Datum temporal_merge_array(PG_FUNCTION_ARGS)
Merge the array of temporal values.
Definition: temporal.c:1163
Datum temporal_minus_max(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the maximum base value.
Definition: temporal.c:3577
Structure to represent information about an entry that can be placed to either group without affectin...
Definition: temporal.h:369
void ensure_positive_datum(Datum size, Oid type)
Ensures that the number is positive.
Definition: temporal.c:394
Oid basetypid
base type's OID (4 bytes)
Definition: temporal.h:284
Datum temporal_always_lt(PG_FUNCTION_ARGS)
Returns true if the temporal value is always less than the base value.
Definition: temporal.c:2897
union bboxunion bboxunion
Structure to represent all types of bounding boxes.
Datum temporal_min_value(PG_FUNCTION_ARGS)
Returns the minimum base value of the temporal value.
Definition: temporal.c:1986
Datum tint_to_tfloat(PG_FUNCTION_ARGS)
Cast the temporal integer value as a temporal float value.
Definition: temporal.c:1373
Oid basetypid
base type's OID (4 bytes)
Definition: temporal.h:258
Structure to represent temporal values of instant set subtype.
Definition: temporal.h:266
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) ...
Definition: temporal.c:2690
Datum tnumber_minus_ranges(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the array of ranges of base values.
Definition: temporal.c:3498
double c
Definition: temporal.h:343
Datum temporal_minus_periodset(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the period set.
Definition: temporal.c:3870
Datum tinstant_get_value(PG_FUNCTION_ARGS)
Returns the base value of the temporal instant value.
Definition: temporal.c:1710
void ensure_common_dimension(int16 flags1, int16 flags2)
Ensure that the temporal values have at least one common dimension.
Definition: temporal.c:277
int32 count
number of TSequence elements
Definition: temporal.h:299
Datum tfloat_ranges(const Temporal *temp)
Returns the base values of the temporal float value as an array of ranges (dispatch function) ...
Definition: temporal.c:1676
Structure to represent values of the internal type for computing aggregates for 2D temporal point typ...
Definition: temporal.h:328
Datum temporal_minus_min(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the minimum base value.
Definition: temporal.c:3557
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.
Definition: temporal.c:2625
Datum temporal_timestamp_n(PG_FUNCTION_ARGS)
Returns the n-th distinct timestamp of the temporal value.
Definition: temporal.c:2464
Datum(* datum_func2)(Datum, Datum)
Definition: temporal.h:358
int16 subtype
subtype
Definition: temporal.h:296
int index
Definition: temporal.h:372
PeriodSet * temporal_get_time_internal(const Temporal *temp)
Returns the time on which the temporal value is defined as a period set (dispatch function) ...
Definition: temporal.c:1728
Datum temporal_always_ne(PG_FUNCTION_ARGS)
Returns true if the temporal value is always different from the base value.
Definition: temporal.c:2875
void temporal_bbox(void *box, const Temporal *temp)
Set the first argument to the bounding box of the temporal value.
Definition: temporal.c:1800
double b
Definition: temporal.h:342
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 ...
Definition: temporal.c:317
double delta
Definition: temporal.h:374
Temporal * temporal_copy(const Temporal *temp)
Returns a copy of the temporal value.
Definition: temporal.c:457
void temporal_period(Period *p, const Temporal *temp)
Returns the bounding period on which the temporal value is defined (dispatch function) ...
Definition: temporal.c:1419
Datum temporal_always_ge(PG_FUNCTION_ARGS)
Returns true if the temporal value is always greater than or equal to the base value.
Definition: temporal.c:2959
void ensure_same_base_type(const Temporal *temp1, const Temporal *temp2)
Ensures that the two temporal values have the same base type.
Definition: temporal.c:290
const TInstant * tinstarr_inst_n(const Temporal *temp, int n)
Returns the n-th instant of the temporal instant set or a temporal sequence value.
Definition: temporal.c:2288
int16 subtype
subtype
Definition: temporal.h:146
void temporal_write(const Temporal *temp, StringInfo buf)
Write the binary representation of the temporal value into the buffer (dispatch function) ...
Definition: temporal.c:667
void ensure_valid_tempsubtype(int16 type)
Ensures that the temporal type is valid.
Definition: temporal.c:208
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 t...
Definition: temporal.c:349
int16 subtype
subtype
Definition: temporal.h:256
Temporal * temporal_read(StringInfo buf, Oid basetypid)
Returns a new temporal value from its binary representation read from the buffer (dispatch function) ...
Definition: temporal.c:705
Datum temporal_always_eq(PG_FUNCTION_ARGS)
Returns true if the temporal value is always equal to the base value.
Definition: temporal.c:2855
Datum temporal_minus_timestampset(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the timestamp set.
Definition: temporal.c:3740
Datum temporal_at_timestamp(PG_FUNCTION_ARGS)
Restricts the temporal value to the timestamp.
Definition: temporal.c:3629
Datum temporal_ge(PG_FUNCTION_ARGS)
Returns true if the first temporal value is greater than or equal to the second one.
Definition: temporal.c:4438
char * temporal_to_string(const Temporal *temp, char *(*value_out)(Oid, Datum))
Returns the string representation of the temporal value (dispatch function)
Definition: temporal.c:631
int16 subtype
subtype
Definition: temporal.h:244
char * subtypeName
string representing the temporal type
Definition: temporal.h:145
double b
Definition: temporal.h:331
Datum tlinearseq_constructor(PG_FUNCTION_ARGS)
Construct a temporal sequence value with linear or stepwise interpolation from the array of temporal ...
Definition: temporal.c:887
Temporal * temporal_restrict_timestamp_internal(const Temporal *temp, TimestampTz t, bool atfunc)
Restricts the temporal value to the timestamp (dispatch function)
Definition: temporal.c:3589
Functions for spatiotemporal bounding boxes.
Datum temporal_minus_timestamp(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the timestamp.
Definition: temporal.c:3639
void ensure_valid_tempsubtype_all(int16 type)
Ensures that the temporal type is valid.
Definition: temporal.c:222
Datum temporal_in(PG_FUNCTION_ARGS)
Generic input function for temporal types.
Definition: temporal.c:608
Datum temporal_ever_ne(PG_FUNCTION_ARGS)
Returns true if the temporal value is ever different from the base value.
Definition: temporal.c:2865
Structure to represent values of the internal type for computing aggregates for 3D temporal point typ...
Definition: temporal.h:339
Definition: temporal.h:122
Datum temporal_instant_n(PG_FUNCTION_ARGS)
Returns the n-th instant of the temporal value.
Definition: temporal.c:2302
Datum tnumber_to_tbox(PG_FUNCTION_ARGS)
Returns the bounding box of the temporal value.
Definition: temporal.c:1819
double d
Definition: temporal.h:344
Datum temporal_end_value(PG_FUNCTION_ARGS)
Returns the end base value of the temporal value.
Definition: temporal.c:1909
Structure to represent temporal values of sequence subtype.
Definition: temporal.h:279
int32 vl_len_
varlena header (do not touch directly!)
Definition: temporal.h:243
Temporal * tint_to_tfloat_internal(Temporal *temp)
Cast the temporal integer value as a temporal float value (dispatch function)
Definition: temporal.c:1354
const TInstant * temporal_end_instant_internal(const Temporal *temp)
Returns the end instant of the temporal value (internal function).
Definition: temporal.c:2251
const char * tempsubtype_name(int16 subtype)
Returns the string representation of the subtype of the temporal type corresponding to the enum value...
Definition: temporal.c:122
Datum temporal_start_timestamp(PG_FUNCTION_ARGS)
Returns the start timestamp of the temporal value.
Definition: temporal.c:2407
Datum(* datum_func3)(Datum, Datum, Datum)
Definition: temporal.h:359
Datum temporal_at_period(PG_FUNCTION_ARGS)
Restricts the temporal value to the period.
Definition: temporal.c:3796
Datum(* varfunc)(Datum,...)
Definition: temporal.h:355
Datum temporal_to_period(PG_FUNCTION_ARGS)
Returns the bounding period on which the temporal value is defined.
Definition: temporal.c:1438
Datum temporal_eq(PG_FUNCTION_ARGS)
Returns true if the two temporal values are equal.
Definition: temporal.c:4358
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253