34#ifndef __PG_TEMPORAL_H__
35#define __PG_TEMPORAL_H__
39#include <lib/stringinfo.h>
41#include "general/meos_catalog.h"
42#include "general/span.h"
50#include <utils/palloc.h>
51#include <utils/elog.h>
52#include <utils/array.h>
53#include <utils/lsyscache.h>
54#include <catalog/pg_type_d.h>
72#define PG_GETARG_ANYDATUM(X) (get_typlen(get_fn_expr_argtype(fcinfo->flinfo, X)) == -1 ? \
73 PointerGetDatum(PG_GETARG_VARLENA_P(X)) : PG_GETARG_DATUM(X))
80#define RTOverBeforeStrategyNumber 28
81#define RTBeforeStrategyNumber 29
82#define RTAfterStrategyNumber 30
83#define RTOverAfterStrategyNumber 31
84#define RTOverFrontStrategyNumber 32
85#define RTFrontStrategyNumber 33
86#define RTBackStrategyNumber 34
87#define RTOverBackStrategyNumber 35
93#define GinOverlapStrategy 1
94#define GinContainsStrategy 2
95#define GinContainedStrategy 3
96#define GinEqualStrategy 4
144#define LIMIT_RATIO 0.3
147#define FLOAT8_EQ(a,b) (float8_cmp_internal(a, b) == 0)
148#define FLOAT8_LT(a,b) (float8_cmp_internal(a, b) < 0)
149#define FLOAT8_LE(a,b) (float8_cmp_internal(a, b) <= 0)
150#define FLOAT8_GT(a,b) (float8_cmp_internal(a, b) > 0)
151#define FLOAT8_GE(a,b) (float8_cmp_internal(a, b) >= 0)
152#define FLOAT8_MAX(a,b) (FLOAT8_GT(a, b) ? (a) : (b))
153#define FLOAT8_MIN(a,b) (FLOAT8_LT(a, b) ? (a) : (b))
170#define TYPMOD_GET_SUBTYPE(typmod) ((int16) ((typmod == -1) ? (0) : (typmod & 0x0000000F)))
181#define TEMPSUBTYPE_STRUCT_ARRAY_LEN \
182 (sizeof tempsubtype_struct_array/sizeof(struct tempsubtype_struct))
183#define TEMPSUBTYPE_MAX_LEN 13
signed short int16
Functions for building a cache of temporal types and operators.
Definition: meos_catalog.h:41
uint32_t time_max_header_size(void)
Return the size in bytes to read from toast to get the basic information from a variable-length time ...
Definition: temporal.c:96
const char * tempsubtype_name(int16 subtype)
Return the string representation of the subtype of the temporal type corresponding to the enum value.
Definition: temporal.c:182
Temporal * temporal_recv(StringInfo buf)
Return a temporal value from its binary representation read from a buffer.
Definition: temporal.c:527
void _PG_init(void)
Initialize the MobilityDB extension.
Definition: temporal.c:80
Datum float8_numeric(PG_FUNCTION_ARGS)
Datum numeric_round(PG_FUNCTION_ARGS)
void ensure_non_empty_array(ArrayType *array)
Ensure that the array is not empty.
Definition: temporal.c:141
void store_fcinfo(FunctionCallInfo fcinfo)
Store in the cache the fcinfo of the external function.
Definition: temporal.c:126
FunctionCallInfo fetch_fcinfo()
Fetch from the cache the fcinfo of the external function.
Definition: temporal.c:116
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:546
SPGistIndexType
Enumeration for the types of SP-GiST indexes.
Definition: temporal.h:161
@ SPGIST_KDTREE
Definition: temporal.h:163
@ SPGIST_QUADTREE
Definition: temporal.h:162
bool tempsubtype_from_string(const char *str, int16 *subtype)
Return the enum value corresponding to the string representation of the concrete subtype of a tempora...
Definition: temporal.c:192
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
int index
Definition: temporal.h:125
double delta
Definition: temporal.h:127
Structure to represent information about an entry that can be placed to either group without affectin...
Definition: temporal.h:123
double lower
Definition: temporal.h:135
double upper
Definition: temporal.h:136
Structure to represent a projection of bounding box to an axis.
Definition: temporal.h:134
Datum * values
Definition: temporal.h:111
int count
Definition: temporal.h:109
bool done
Definition: temporal.h:107
int i
Definition: temporal.h:108
Temporal * temp
Definition: temporal.h:110
Structure to represent the state when unnesting a temporal type.
Definition: temporal.h:106
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:136
char * subtypeName
string representing the temporal type
Definition: temporal.h:177
int16 subtype
subtype
Definition: temporal.h:178
Structure to represent the temporal subtype array.
Definition: temporal.h:176