36 #ifndef __PERIODSET_H__ 37 #define __PERIODSET_H__ 40 #include <catalog/pg_type.h> void periodset_to_period_internal(Period *p, const PeriodSet *ps)
Returns the bounding period on which the period set value is defined (internal function) ...
Definition: periodset.c:410
Datum periodset_recv(PG_FUNCTION_ARGS)
Receive function for period set values.
Definition: periodset.c:303
TimestampTz periodset_start_timestamp_internal(const PeriodSet *ps)
Returns the start timestamp of the period set value (internal function)
Definition: periodset.c:614
void periodset_bbox(Period *p, const PeriodSet *ps)
Copy in the first argument the bounding box of the timestamp set value.
Definition: periodset.c:75
Datum periodset_start_period(PG_FUNCTION_ARGS)
Returns the start period of the period set value.
Definition: periodset.c:507
Structure to represent periods.
Definition: timetypes.h:52
char * periodset_to_string(const PeriodSet *ps)
Returns the string representation of the period set value.
Definition: periodset.c:247
Datum periodset_gt(PG_FUNCTION_ARGS)
Returns true if the first period set value is greater than the second one.
Definition: periodset.c:938
PeriodSet * timestampset_to_periodset_internal(const TimestampSet *ts)
Cast the timestamp set value as a period set value (internal function)
Definition: periodset.c:369
Datum periodset_mem_size(PG_FUNCTION_ARGS)
Returns the size in bytes of the period set value.
Definition: periodset.c:441
const Period * periodset_per_n(const PeriodSet *ps, int index)
Returns the n-th period of the period set value.
Definition: periodset.c:57
void normalize(POINT3D *p)
Datum timestampset_to_periodset(PG_FUNCTION_ARGS)
Cast the timestamp set value as a period set value.
Definition: periodset.c:386
bool periodset_ne_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the first period set value is different from the second one (internal function) ...
Definition: periodset.c:864
Datum periodset_timestamp_n(PG_FUNCTION_ARGS)
Returns the n-th timestamp of the period set value.
Definition: periodset.c:663
bool periodset_eq_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns true if the first period set value is equal to the second one (internal function) ...
Definition: periodset.c:828
Datum periodset_cmp(PG_FUNCTION_ARGS)
Returns -1, 0, or 1 depending on whether the first period set value is less than, equal...
Definition: periodset.c:811
int periodset_cmp_internal(const PeriodSet *ps1, const PeriodSet *ps2)
Returns -1, 0, or 1 depending on whether the first period set value is less than, equal...
Definition: periodset.c:778
Datum periodset_num_periods(PG_FUNCTION_ARGS)
Returns the number of periods of the period set value.
Definition: periodset.c:494
PeriodSet * periodset_shift_internal(const PeriodSet *ps, const Interval *interval)
Shift the period set value by the interval (internal function)
Definition: periodset.c:740
Datum periodset_period_n(PG_FUNCTION_ARGS)
Returns the n-th period of the period set value.
Definition: periodset.c:533
Datum periodset_ne(PG_FUNCTION_ARGS)
Returns true if the first period set value is different from the second one.
Definition: periodset.c:874
Datum periodset_out(PG_FUNCTION_ARGS)
Output function for period set values.
Definition: periodset.c:266
Datum periodset_in(PG_FUNCTION_ARGS)
Input function for period set values.
Definition: periodset.c:236
Structure to represent period sets.
Definition: timetypes.h:84
Datum periodset_end_period(PG_FUNCTION_ARGS)
Returns the end period of the period set value.
Definition: periodset.c:520
Datum periodset_timestamps(PG_FUNCTION_ARGS)
Returns the timestamps of the period set value.
Definition: periodset.c:713
Datum periodset_le(PG_FUNCTION_ARGS)
Returns true if the first period set value is less than or equal to the second one.
Definition: periodset.c:907
Datum periodset_to_period(PG_FUNCTION_ARGS)
Returns the bounding period on which the period set value is defined.
Definition: periodset.c:423
Datum period_to_periodset(PG_FUNCTION_ARGS)
Cast the period value as a period set value.
Definition: periodset.c:398
Datum periodset_end_timestamp(PG_FUNCTION_ARGS)
Returns the end timestamp of the period set value.
Definition: periodset.c:649
Functions for time types based on TimestampTz, that is, TimestampSet, Period, and PeriodSet...
Structure to represent timestamp sets.
Definition: timetypes.h:73
TimestampTz periodset_end_timestamp_internal(const PeriodSet *ps)
Returns the end timestamp of the period set value (internal function)
Definition: periodset.c:638
const Period ** periodset_periods_internal(const PeriodSet *ps)
Returns the periods of the period set value (internal function)
Definition: periodset.c:550
Datum periodset_start_timestamp(PG_FUNCTION_ARGS)
Returns the start timestamp of the period set value.
Definition: periodset.c:625
PeriodSet * timestamp_to_periodset_internal(TimestampTz t)
Cast the timestamp value as a period set value (internal function)
Definition: periodset.c:345
const Period * periodset_bbox_ptr(const PeriodSet *ps)
Returns a pointer to the precomputed bounding box of the period set value.
Definition: periodset.c:66
PeriodSet * periodset_make(const Period **periods, int count, bool normalize)
Construct a period set from an array of periods.
Definition: periodset.c:100
Datum periodset_eq(PG_FUNCTION_ARGS)
Returns true if the first period set value is equal to the second one.
Definition: periodset.c:849
Datum periodset_send(PG_FUNCTION_ARGS)
Send function for period set values.
Definition: periodset.c:279
Datum timestamp_to_periodset(PG_FUNCTION_ARGS)
Cast the timestamp value as a period set value.
Definition: periodset.c:358
PeriodSet * period_to_periodset_internal(const Period *p)
Construct a period set from a period (internal function)
Definition: periodset.c:161
Datum periodset_timespan(PG_FUNCTION_ARGS)
Returns the timespan of the period set value.
Definition: periodset.c:454
Datum periodset_ge(PG_FUNCTION_ARGS)
Returns true if the first period set value is greater than or equal to the second one...
Definition: periodset.c:923
Datum periodset_duration(PG_FUNCTION_ARGS)
Returns the timespan of the period set value.
Definition: periodset.c:470
bool periodset_find_timestamp(const PeriodSet *ps, TimestampTz t, int *loc)
Returns the location of the timestamp in the temporal sequence set value using binary search...
Definition: periodset.c:201
PeriodSet * periodset_copy(const PeriodSet *ps)
Returns a copy of the period set.
Definition: periodset.c:170
Datum periodset_periods(PG_FUNCTION_ARGS)
Returns the periods of the period set value.
Definition: periodset.c:563
Datum periodset_num_timestamps(PG_FUNCTION_ARGS)
Returns the number of timestamps of the period set value.
Definition: periodset.c:578
Datum periodset_lt(PG_FUNCTION_ARGS)
Returns true if the first period set value is less than the second one.
Definition: periodset.c:891
PeriodSet * periodset_make_free(Period **periods, int count, bool normalize)
Construct a period set from an array of periods and free the array and the periods after the creation...
Definition: periodset.c:144
Datum periodset_shift(PG_FUNCTION_ARGS)
Shift the period set value by the interval.
Definition: periodset.c:757
Datum periodset_constructor(PG_FUNCTION_ARGS)
Construct a period set from an array of period values.
Definition: periodset.c:323