63#define PG_GETARG_TIMESTAMP(n) DatumGetTimestamp(PG_GETARG_DATUM(n))
64#define PG_GETARG_TIMESTAMPTZ(n) DatumGetTimestampTz(PG_GETARG_DATUM(n))
65#define PG_GETARG_INTERVAL_P(n) DatumGetIntervalP(PG_GETARG_DATUM(n))
67#define PG_RETURN_TIMESTAMP(x) return TimestampGetDatum(x)
68#define PG_RETURN_TIMESTAMPTZ(x) return TimestampTzGetDatum(x)
69#define PG_RETURN_INTERVAL_P(x) return IntervalPGetDatum(x)
72#define TIMESTAMP_MASK(b) (1 << (b))
73#define INTERVAL_MASK(b) (1 << (b))
76#define INTERVAL_FULL_RANGE (0x7FFF)
77#define INTERVAL_RANGE_MASK (0x7FFF)
78#define INTERVAL_FULL_PRECISION (0xFFFF)
79#define INTERVAL_PRECISION_MASK (0xFFFF)
80#define INTERVAL_TYPMOD(p,r) ((((r) & INTERVAL_RANGE_MASK) << 16) | ((p) & INTERVAL_PRECISION_MASK))
81#define INTERVAL_PRECISION(t) ((t) & INTERVAL_PRECISION_MASK)
82#define INTERVAL_RANGE(t) (((t) >> 16) & INTERVAL_RANGE_MASK)
85#define TimestampTzPlusMilliseconds(tz,ms) ((tz) + ((ms) * (int64) 1000))
86#define TimestampTzPlusSeconds(tz,s) ((tz) + ((s) * (int64) 1000000))
104 long *secs,
int *microsecs);
118 fsec_t *fsec,
const char **tzn,
pg_tz *attimezone);
131#define timestamptz_cmp_internal(dt1,dt2) timestamp_cmp_internal(dt1, dt2)
139extern void isoweek2date(
int woy,
int *year,
int *mon,
int *mday);
140extern void isoweekdate2date(
int isoweek,
int wday,
int *year,
int *mon,
int *mday);
Datum Int64GetDatum(int64 X)
static int64 DatumGetInt64(Datum X)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
void dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec)
int timestamp_cmp_internal(Timestamp dt1, Timestamp dt2)
long TimestampDifferenceMilliseconds(TimestampTz start_time, TimestampTz stop_time)
void isoweek2date(int woy, int *year, int *mon, int *mday)
void GetEpochTime(struct pg_tm *tm)
int itmin2interval(struct pg_itm_in *itm_in, Interval *span)
int isoweek2j(int year, int week)
TimestampTz time_t_to_timestamptz(pg_time_t tm)
static Datum TimestampTzGetDatum(TimestampTz X)
int date2isoweek(int year, int mon, int mday)
Timestamp SetEpochTimestamp(void)
static Datum TimestampGetDatum(Timestamp X)
static Datum IntervalPGetDatum(const Interval *X)
TimestampTz timestamp2timestamptz_opt_overflow(Timestamp timestamp, int *overflow)
int date2isoyearday(int year, int mon, int mday)
int tm2timestamp(struct pg_tm *tm, fsec_t fsec, int *tzp, Timestamp *result)
void TimestampDifference(TimestampTz start_time, TimestampTz stop_time, long *secs, int *microsecs)
bool TimestampTimestampTzRequiresRewrite(void)
void isoweekdate2date(int isoweek, int wday, int *year, int *mon, int *mday)
int32 timestamp_cmp_timestamptz_internal(Timestamp timestampVal, TimestampTz dt2)
bool TimestampDifferenceExceeds(TimestampTz start_time, TimestampTz stop_time, int msec)
PGDLLIMPORT TimestampTz PgReloadTime
PGDLLIMPORT TimestampTz PgStartTime
int timestamp2tm(Timestamp dt, int *tzp, struct pg_tm *tm, fsec_t *fsec, const char **tzn, pg_tz *attimezone)
int32 anytimestamp_typmod_check(bool istz, int32 typmod)
TimestampTz GetCurrentTimestamp(void)
const char * timestamptz_to_str(TimestampTz t)
static Interval * DatumGetIntervalP(Datum X)
Timestamp GetSQLLocalTimestamp(int32 typmod)
void interval2itm(Interval span, struct pg_itm *itm)
static Timestamp DatumGetTimestamp(Datum X)
int itm2interval(struct pg_itm *itm, Interval *span)
pg_time_t timestamptz_to_time_t(TimestampTz t)
static TimestampTz DatumGetTimestampTz(Datum X)
int date2isoyear(int year, int mon, int mday)
TimestampTz GetSQLCurrentTimestamp(int32 typmod)