![]() |
MobilityDB 1.3
|
Functions for base and time types corresponding to external PostgreSQL functions in order to bypass the function manager fmgr.c
.
More...
#include "temporal/postgres_types.h"
#include <float.h>
#include <math.h>
#include <limits.h>
#include <postgres.h>
#include <common/int.h>
#include <common/int128.h>
#include <utils/datetime.h>
#include "utils/timestamp_def.h"
#include "utils/formatting.h"
#include <common/hashfn.h>
#include <liblwgeom_internal.h>
#include <meos.h>
#include <meos_internal.h>
#include "temporal/temporal.h"
Macros | |
#define | MAXINT4LEN 12 |
#define | MAXINT8LEN 20 |
#define | SAMESIGN(a, b) (((a) < 0) == ((b) < 0)) |
Functions | |
DateADT | add_date_int (DateADT d, int32 days) |
Return the addition of a date and a number of days. More... | |
Interval * | add_interval_interval (const Interval *interv1, const Interval *interv2) |
Return the addition of two intervals. More... | |
TimestampTz | add_timestamptz_interval (TimestampTz t, const Interval *interv) |
Return the addition of a timestamp and an interval. More... | |
static void | AdjustIntervalForTypmod (Interval *interval, int32 typmod) |
bool | bool_in (const char *str) |
Return a boolean from its string representation. More... | |
char * | bool_out (bool b) |
Return the string representation of a boolean. More... | |
bytea * | bstring2bytea (const uint8_t *wkb, size_t size) |
Convert a C binary string into a bytea. More... | |
text * | cstring2text (const char *str) |
Convert a C string into a text. More... | |
static TimestampTz | date2timestamp (DateADT dateVal) |
Timestamp | date2timestamp_opt_overflow (DateADT dateVal, int *overflow) |
TimestampTz | date2timestamptz_opt_overflow (DateADT dateVal, int *overflow) |
DateADT | date_in (const char *str) |
Return a date from its string representation. More... | |
char * | date_out (DateADT d) |
Return the string representation of a date. More... | |
Timestamp | date_to_timestamp (DateADT d) |
Convert a date into a timestamp. More... | |
TimestampTz | date_to_timestamptz (DateADT d) |
Convert a date into a timestamptz. More... | |
Datum | datum_initcap (Datum value) |
Convert the text value to uppercase. More... | |
Datum | datum_lower (Datum value) |
Return the text value transformed to lowercase. More... | |
Datum | datum_textcat (Datum l, Datum r) |
Return the concatenation of the two text values. More... | |
Datum | datum_upper (Datum value) |
Return the text value transformed to uppercase. More... | |
double | float8_in (const char *num, const char *type_name, const char *orig_string) |
double | float8_in_opt_error (char *num, const char *type_name, const char *orig_string) |
float8in_internal_opt_error - guts of float8in() More... | |
char * | float8_out (double num, int maxdd) |
int32 | int4_in (const char *str) |
Return an int4 from a string. More... | |
char * | int4_out (int32 val) |
Return a string from an int4. More... | |
int64 | int8_in (const char *str) |
Return an int8 from a string. More... | |
char * | int8_out (int64 val) |
Return a string from an int8 . More... | |
int | interval_cmp (const Interval *interv1, const Interval *interv2) |
Return the comparison of two intervals. More... | |
static INT128 | interval_cmp_value (const Interval *interval) |
Interval * | interval_in (const char *str, int32 prec) |
Return an interval from its string representation. More... | |
Interval * | interval_make (int32 years, int32 months, int32 weeks, int32 days, int32 hours, int32 mins, double secs) |
Return an interval constructed from its arguments. More... | |
void | interval_negate (const Interval *interval, Interval *result) |
Negate an interval. More... | |
char * | interval_out (const Interval *interv) |
Return the string representation of an interval. More... | |
static int | interval_sign (const Interval *interval) |
void | MEOSAdjustTimeForTypmod (TimeADT *time, int32 typmod) |
Force the precision of the time value to a specified value. More... | |
void | MEOSAdjustTimestampForTypmod (Timestamp *time, int32 typmod) |
bool | MEOSAdjustTimestampForTypmodError (Timestamp *time, int32 typmod, bool *error) |
Interval * | minus_date_date (DateADT d1, DateADT d2) |
Return the subtraction of two dates. More... | |
DateADT | minus_date_int (DateADT d, int32 days) |
Return the subtraction of a date and a number of days. More... | |
TimestampTz | minus_timestamptz_interval (TimestampTz t, const Interval *interv) |
Return the subtraction of a timestamptz and an interval. More... | |
Interval * | minus_timestamptz_timestamptz (TimestampTz t1, TimestampTz t2) |
Return the subtraction of two timestamptz values. More... | |
Interval * | mul_interval_double (const Interval *interv, double factor) |
Return the multiplication of an interval and a factor. More... | |
static bool | parse_bool_with_len (const char *value, size_t len, bool *result) |
float8 | pg_datan (float8 arg1) |
Return the arctan of a double (radians) More... | |
float8 | pg_datan2 (float8 arg1, float8 arg2) |
Return the arctan of two doubles (radians) More... | |
DateADT | pg_date_in (const char *str) |
char * | pg_date_out (DateADT d) |
float8 | pg_dcos (float8 arg1) |
Return the cosine of arg1 (radians) More... | |
float8 | pg_dsin (float8 arg1) |
Return the sine of arg1 (radians) More... | |
uint32 | pg_hashfloat8 (float8 key) |
Get the 32-bit hash value of an float64 value. More... | |
uint64 | pg_hashfloat8extended (float8 key, uint64 seed) |
Get the 64-bit hash value of a float64 value. More... | |
uint32 | pg_hashint8 (int64 val) |
Get the 32-bit hash value of an int64 value. More... | |
uint64 | pg_hashint8extended (int64 val, uint64 seed) |
Get the 64-bit hash value of an int64 value. More... | |
uint32 | pg_hashtext (text *key) |
Get the 32-bit hash value of an text value. More... | |
uint64 | pg_hashtextextended (text *key, uint64 seed) |
Get the 32-bit hash value of an text value. More... | |
int | pg_interval_cmp (const Interval *interv1, const Interval *interv2) |
Interval * | pg_interval_in (const char *str, int32 prec) |
Interval * | pg_interval_justify_hours (const Interval *interv) |
Add an interval to a timestamp data type. More... | |
char * | pg_interval_out (const Interval *interv) |
int | pg_lltoa (int64 value, char *a) |
int | pg_ltoa (int32 value, char *a) |
int32 | pg_strtoint32 (const char *s) |
Return an input string converted to a signed 32 bit integer. More... | |
int64 | pg_strtoint64 (const char *s) |
Timestamp | pg_timestamp_in (const char *str, int32 prec) |
char * | pg_timestamp_out (Timestamp t) |
TimestampTz | pg_timestamptz_in (const char *str, int32 prec) |
char * | pg_timestamptz_out (TimestampTz t) |
int | pg_ulltoa_n (uint64 l, char *a) |
int | pg_ultoa_n (uint32 value, char *a) |
char * | pnstrdup (const char *in, Size size) |
Return a copy of the string value. More... | |
char * | text2cstring (const text *txt) |
Convert a text into a C string. More... | |
int | text_cmp (const text *txt1, const text *txt2) |
Comparison function for text values. More... | |
text * | text_copy (const text *txt) |
Copy a text value. More... | |
text * | text_initcap (const text *txt) |
Convert the text value to initcap. More... | |
text * | text_lower (const text *txt) |
Return the text value transformed to lowercase. More... | |
text * | text_upper (const text *txt) |
Return the text value transformed to uppercase. More... | |
text * | textcat_text_text (const text *txt1, const text *txt2) |
Return the concatenation of the two text values. More... | |
TimeADT | time_in (const char *str, int32 prec) |
Return a time from its string representation. More... | |
char * | time_out (TimeADT t) |
Return the string representation of a time. More... | |
Timestamp | timestamp_in (const char *str, int32 prec) |
Return a timestamp without time zone from its string representation. More... | |
TimestampTz | timestamp_in_common (const char *str, int32 typmod, bool withtz) |
Return either timestamp or a timestamp with timezone from its string representation. More... | |
char * | timestamp_out (Timestamp t) |
Return the string representation of a timestamp without timezone. More... | |
char * | timestamp_out_common (TimestampTz t, bool withtz) |
Return the string representation a timestamp with timezone. More... | |
DateADT | timestamp_to_date (Timestamp t) |
Convert a timestamp into a date. More... | |
TimestampTz | timestamptz_in (const char *str, int32 prec) |
Return the string representation of a timestamp with time zone. More... | |
char * | timestamptz_out (TimestampTz t) |
Return the string representation of a timestamp with timezone. More... | |
DateADT | timestamptz_to_date (TimestampTz t) |
Convert a timestamp with time zone into a date. More... | |
int | varstr_cmp (const char *arg1, int len1, const char *arg2, int len2, Oid collid UNUSED) |
Simplified version of the function in varlena.c where LC_COLLATE is C. More... | |
Functions for base and time types corresponding to external PostgreSQL functions in order to bypass the function manager fmgr.c
.