34#ifndef __PG_TEMPORAL_H__
35#define __PG_TEMPORAL_H__
40#include <catalog/pg_type_d.h>
41#include <lib/stringinfo.h>
42#include <utils/array.h>
43#include <utils/lsyscache.h>
46#include "temporal/meos_catalog.h"
55#define PG_GETARG_ANYDATUM(X) (get_typlen(get_fn_expr_argtype(fcinfo->flinfo, X)) == -1 ? \
56 PointerGetDatum(PG_GETARG_VARLENA_P(X)) : PG_GETARG_DATUM(X))
62#define GinOverlapStrategy 1
63#define GinContainsStrategy 2
64#define GinContainedStrategy 3
65#define GinEqualStrategy 4
113#define LIMIT_RATIO 0.3
116#define FLOAT8_EQ(a,b) (float8_cmp_internal(a, b) == 0)
117#define FLOAT8_LT(a,b) (float8_cmp_internal(a, b) < 0)
118#define FLOAT8_LE(a,b) (float8_cmp_internal(a, b) <= 0)
119#define FLOAT8_GT(a,b) (float8_cmp_internal(a, b) > 0)
120#define FLOAT8_GE(a,b) (float8_cmp_internal(a, b) >= 0)
121#define FLOAT8_MAX(a,b) (FLOAT8_GT(a, b) ? (a) : (b))
122#define FLOAT8_MIN(a,b) (FLOAT8_LT(a, b) ? (a) : (b))
139#define TYPMOD_MAXLEN 64
165#define TYPMOD_GET_TEMPSUBTYPE(typmod) ((typmod & 0x60000000)>>29)
166#define TYPMOD_SET_TEMPSUBTYPE(typmod, tempsubtype) ((typmod) = (((typmod) & 0x9FFFFFFF) | ((tempsubtype & 0x00000003)<<29)))
173#define TIME_MAX_HEADER_SIZE DOUBLE_PAD(Max(sizeof(Set), sizeof(SpanSet)))
interpType input_interp_string(FunctionCallInfo fcinfo, int argno)
Return a temporal instant from a value and a timestamptz @sqlfn tint(), tfloat(), ....
Definition: temporal.c:521
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
interpType
Enumeration that defines the interpolation types used in MEOS.
Definition: meos.h:161
External API of the Mobility Engine Open Source (MEOS) library.
uint32_t time_max_header_size(void)
FunctionCallInfo fetch_fcinfo(void)
Fetch from the cache the fcinfo of the external function.
Definition: temporal.c:104
Temporal * temporal_slice(Datum tempdatum)
Peek into a temporal datum to find the bounding box.
Definition: temporal.c:255
bool ensure_not_empty_array(ArrayType *array)
Ensure that the array is not empty.
Definition: temporal.c:129
Temporal * temporal_recv(StringInfo buf)
Return a temporal value from its binary representation read from a buffer.
Definition: temporal.c:441
void _PG_init(void)
Initialize the MobilityDB extension.
Definition: temporal.c:81
Datum EAcomp_temporal_temporal(FunctionCallInfo fcinfo, int(*func)(const Temporal *, const Temporal *))
Generic function for the ever/always comparison operators.
Definition: temporal_compops.c:99
Datum float8_numeric(PG_FUNCTION_ARGS)
Datum numeric_round(PG_FUNCTION_ARGS)
Datum Tcomp_temporal_temporal(FunctionCallInfo fcinfo, Datum(*func)(Datum, Datum, meosType))
Return the temporal comparison of two temporal values.
Definition: temporal_compops.c:684
Datum Tcomp_temporal_base(FunctionCallInfo fcinfo, Datum(*func)(Datum, Datum, meosType))
Return the temporal comparison of a temporal value and a base value.
Definition: temporal_compops.c:667
text * Datum_as_hexwkb(FunctionCallInfo fcinfo, Datum value, meosType type)
Output a value in the Well-Known Binary (WKB) or Extended Well-Known Binary (EWKB) representation in ...
Definition: type_out.c:253
void store_fcinfo(FunctionCallInfo fcinfo)
Store in the cache the fcinfo of the external function.
Definition: temporal.c:114
Datum numeric_float8(PG_FUNCTION_ARGS)
Basic functions for temporal types of any subtype.
void temporal_write(const Temporal *temp, StringInfo buf)
Write the binary representation of a temporal value into a buffer.
Definition: temporal.c:460
bytea * Datum_as_wkb(FunctionCallInfo fcinfo, Datum value, meosType type, bool extended)
Output a value in the (Extended) Well-Known Binary (WKB or EWKB) representation.
Definition: type_out.c:227
SPGistIndexType
Enumeration for the types of SP-GiST indexes.
Definition: temporal.h:130
@ SPGIST_KDTREE
Definition: temporal.h:132
@ SPGIST_QUADTREE
Definition: temporal.h:131
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
int index
Definition: temporal.h:94
double delta
Definition: temporal.h:96
Structure to represent information about an entry that can be placed to either group without affectin...
Definition: temporal.h:92
double lower
Definition: temporal.h:104
double upper
Definition: temporal.h:105
Structure to represent a projection of bounding box to an axis.
Definition: temporal.h:103
Datum * values
Definition: temporal.h:80
int count
Definition: temporal.h:78
bool done
Definition: temporal.h:76
int i
Definition: temporal.h:77
Temporal * temp
Definition: temporal.h:79
Structure to represent the state when unnesting a temporal type.
Definition: temporal.h:75
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:173
Definition: postgres_ext_defs.in.h:34