MobilityDB  1.0
Data Structures | Macros
timetypes.h File Reference

Functions for time types based on TimestampTz, that is, TimestampSet, Period, and PeriodSet. More...

#include <postgres.h>
#include <access/stratnum.h>
#include <utils/timestamp.h>
Include dependency graph for timetypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Period
 Structure to represent periods. More...
 
struct  PeriodBound
 Internal representation of either bound of a period (not what's on disk) More...
 
struct  TimestampSet
 Structure to represent timestamp sets. More...
 
struct  PeriodSet
 Structure to represent period sets. More...
 

Macros

#define DatumGetTimestampSet(X)   ((TimestampSet *) DatumGetPointer(X))
 
#define TimestampSetGetDatum(X)   PointerGetDatum(X)
 
#define PG_GETARG_TIMESTAMPSET(X)   DatumGetTimestampSet(PG_GETARG_POINTER(X))
 
#define PG_RETURN_TIMESTAMPSET(X)   PG_RETURN_POINTER(X)
 
#define DatumGetPeriod(X)   ((Period *) DatumGetPointer(X))
 
#define PeriodGetDatum(X)   PointerGetDatum(X)
 
#define PG_GETARG_PERIOD(X)   DatumGetPeriod(PG_GETARG_POINTER(X))
 
#define PG_RETURN_PERIOD(X)   PG_RETURN_POINTER(X)
 
#define DatumGetPeriodSet(X)   ((PeriodSet *) DatumGetPointer(X))
 
#define PeriodSetGetDatum(X)   PointerGetDatum(X)
 
#define PG_GETARG_PERIODSET(X)   DatumGetPeriodSet(PG_GETARG_POINTER(X))
 
#define PG_RETURN_PERIODSET(X)   PG_RETURN_POINTER(X)
 

Detailed Description

Functions for time types based on TimestampTz, that is, TimestampSet, Period, and PeriodSet.

The Period type is a specialized version of the RangeType in PostgreSQL. It is considerably more efficient, in particular because it is a fix-length type, it has finite bounds, and do not allow empty periods. The TimestampSet type represents sets of disjoint TimestampTz. The PeriodSet type represents sets of disjoint Period values.