24 #ifdef HAVE_INT64_TIMESTAMP
39 #define DATEVAL_NOBEGIN ((DateADT) PG_INT32_MIN)
40 #define DATEVAL_NOEND ((DateADT) PG_INT32_MAX)
42 #define DATE_NOBEGIN(j) ((j) = DATEVAL_NOBEGIN)
43 #define DATE_IS_NOBEGIN(j) ((j) == DATEVAL_NOBEGIN)
44 #define DATE_NOEND(j) ((j) = DATEVAL_NOEND)
45 #define DATE_IS_NOEND(j) ((j) == DATEVAL_NOEND)
46 #define DATE_NOT_FINITE(j) (DATE_IS_NOBEGIN(j) || DATE_IS_NOEND(j))
54 #ifdef HAVE_INT64_TIMESTAMP
56 #define MAX_TIME_PRECISION 6
58 #define DatumGetDateADT(X) ((DateADT) DatumGetInt32(X))
59 #define DatumGetTimeADT(X) ((TimeADT) DatumGetInt64(X))
60 #define DatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X))
62 #define DateADTGetDatum(X) Int32GetDatum(X)
63 #define TimeADTGetDatum(X) Int64GetDatum(X)
64 #define TimeTzADTPGetDatum(X) PointerGetDatum(X)
67 #define MAX_TIME_PRECISION 10
70 #define TIME_PREC_INV 10000000000.0
71 #define TIMEROUND(j) (rint(((double) (j)) * TIME_PREC_INV) / TIME_PREC_INV)
73 #define DatumGetDateADT(X) ((DateADT) DatumGetInt32(X))
74 #define DatumGetTimeADT(X) ((TimeADT) DatumGetFloat8(X))
75 #define DatumGetTimeTzADTP(X) ((TimeTzADT *) DatumGetPointer(X))
77 #define DateADTGetDatum(X) Int32GetDatum(X)
78 #define TimeADTGetDatum(X) Float8GetDatum(X)
79 #define TimeTzADTPGetDatum(X) PointerGetDatum(X)
82 #define PG_GETARG_DATEADT(n) DatumGetDateADT(PG_GETARG_DATUM(n))
83 #define PG_GETARG_TIMEADT(n) DatumGetTimeADT(PG_GETARG_DATUM(n))
84 #define PG_GETARG_TIMETZADT_P(n) DatumGetTimeTzADTP(PG_GETARG_DATUM(n))
86 #define PG_RETURN_DATEADT(x) return DateADTGetDatum(x)
87 #define PG_RETURN_TIMEADT(x) return TimeADTGetDatum(x)
88 #define PG_RETURN_TIMETZADT_P(x) return TimeTzADTPGetDatum(x)
Datum date_gt(PG_FUNCTION_ARGS)
Datum datetimetz_timestamptz(PG_FUNCTION_ARGS)
Datum timestamptz_date(PG_FUNCTION_ARGS)
Datum timestamptz_lt_date(PG_FUNCTION_ARGS)
Datum timestamptz_time(PG_FUNCTION_ARGS)
Datum timestamptz_le_date(PG_FUNCTION_ARGS)
Datum timestamp_cmp_date(PG_FUNCTION_ARGS)
Datum timetz_recv(PG_FUNCTION_ARGS)
Datum timestamp_ge_date(PG_FUNCTION_ARGS)
Datum timetz_cmp(PG_FUNCTION_ARGS)
Datum timetz_hash(PG_FUNCTION_ARGS)
Datum overlaps_timetz(PG_FUNCTION_ARGS)
Datum date_lt_timestamptz(PG_FUNCTION_ARGS)
Datum timetz_lt(PG_FUNCTION_ARGS)
Datum timetz_out(PG_FUNCTION_ARGS)
Datum timetztypmodin(PG_FUNCTION_ARGS)
Datum timestamp_date(PG_FUNCTION_ARGS)
Datum time_hash(PG_FUNCTION_ARGS)
Datum timestamp_gt_date(PG_FUNCTION_ARGS)
Datum date_smaller(PG_FUNCTION_ARGS)
Datum time_eq(PG_FUNCTION_ARGS)
Datum timetypmodout(PG_FUNCTION_ARGS)
Datum timetz_ge(PG_FUNCTION_ARGS)
Datum time_send(PG_FUNCTION_ARGS)
Datum time_in(PG_FUNCTION_ARGS)
Datum timetztypmodout(PG_FUNCTION_ARGS)
Datum date_ne(PG_FUNCTION_ARGS)
Datum timetz_gt(PG_FUNCTION_ARGS)
Datum date_mi_interval(PG_FUNCTION_ARGS)
Datum date_lt(PG_FUNCTION_ARGS)
Datum timestamp_le_date(PG_FUNCTION_ARGS)
void EncodeSpecialDate(DateADT dt, char *str)
Datum timetz_smaller(PG_FUNCTION_ARGS)
Datum abstime_date(PG_FUNCTION_ARGS)
Datum overlaps_time(PG_FUNCTION_ARGS)
Datum date_cmp(PG_FUNCTION_ARGS)
double date2timestamp_no_overflow(DateADT dateVal)
Datum time_smaller(PG_FUNCTION_ARGS)
Datum timestamptz_timetz(PG_FUNCTION_ARGS)
Datum date_finite(PG_FUNCTION_ARGS)
Datum timetz_part(PG_FUNCTION_ARGS)
Datum time_larger(PG_FUNCTION_ARGS)
Datum date_timestamp(PG_FUNCTION_ARGS)
Datum time_transform(PG_FUNCTION_ARGS)
Datum time_mi_time(PG_FUNCTION_ARGS)
Datum timestamptz_eq_date(PG_FUNCTION_ARGS)
Datum date_gt_timestamptz(PG_FUNCTION_ARGS)
Datum date_ge_timestamp(PG_FUNCTION_ARGS)
Datum time_out(PG_FUNCTION_ARGS)
Datum timetz_mi_interval(PG_FUNCTION_ARGS)
Datum timetz_send(PG_FUNCTION_ARGS)
Datum time_part(PG_FUNCTION_ARGS)
Datum timetz_le(PG_FUNCTION_ARGS)
Datum timetz_scale(PG_FUNCTION_ARGS)
Datum time_ge(PG_FUNCTION_ARGS)
Datum date_mii(PG_FUNCTION_ARGS)
Datum timetz_larger(PG_FUNCTION_ARGS)
Datum date_cmp_timestamp(PG_FUNCTION_ARGS)
Datum time_cmp(PG_FUNCTION_ARGS)
Datum date_in(PG_FUNCTION_ARGS)
Datum date_ge(PG_FUNCTION_ARGS)
Datum timestamp_eq_date(PG_FUNCTION_ARGS)
Datum timetz_izone(PG_FUNCTION_ARGS)
Datum date_le_timestamp(PG_FUNCTION_ARGS)
Datum timetz_in(PG_FUNCTION_ARGS)
Datum time_recv(PG_FUNCTION_ARGS)
Datum time_pl_interval(PG_FUNCTION_ARGS)
Datum date_le(PG_FUNCTION_ARGS)
Datum timestamp_ne_date(PG_FUNCTION_ARGS)
Datum timestamptz_cmp_date(PG_FUNCTION_ARGS)
Datum interval_time(PG_FUNCTION_ARGS)
Datum timetz_ne(PG_FUNCTION_ARGS)
Datum timetz_eq(PG_FUNCTION_ARGS)
Datum make_date(PG_FUNCTION_ARGS)
Datum time_scale(PG_FUNCTION_ARGS)
Datum timetz_time(PG_FUNCTION_ARGS)
Datum date_ge_timestamptz(PG_FUNCTION_ARGS)
Datum date_ne_timestamp(PG_FUNCTION_ARGS)
Datum date_eq_timestamp(PG_FUNCTION_ARGS)
Datum date_ne_timestamptz(PG_FUNCTION_ARGS)
Datum time_interval(PG_FUNCTION_ARGS)
Datum time_lt(PG_FUNCTION_ARGS)
Datum date_lt_timestamp(PG_FUNCTION_ARGS)
Datum date_recv(PG_FUNCTION_ARGS)
Datum time_ne(PG_FUNCTION_ARGS)
Datum date_out(PG_FUNCTION_ARGS)
Datum timetz_zone(PG_FUNCTION_ARGS)
Datum timestamp_time(PG_FUNCTION_ARGS)
Datum timestamptz_ge_date(PG_FUNCTION_ARGS)
Datum time_timetz(PG_FUNCTION_ARGS)
Datum date_eq_timestamptz(PG_FUNCTION_ARGS)
Datum date_mi(PG_FUNCTION_ARGS)
Datum datetime_timestamp(PG_FUNCTION_ARGS)
Datum date_sortsupport(PG_FUNCTION_ARGS)
Datum timestamptz_ne_date(PG_FUNCTION_ARGS)
Datum time_le(PG_FUNCTION_ARGS)
Datum date_cmp_timestamptz(PG_FUNCTION_ARGS)
Datum date_eq(PG_FUNCTION_ARGS)
Datum timetz_pl_interval(PG_FUNCTION_ARGS)
Datum date_le_timestamptz(PG_FUNCTION_ARGS)
Datum make_time(PG_FUNCTION_ARGS)
Datum timestamp_lt_date(PG_FUNCTION_ARGS)
Datum date_pl_interval(PG_FUNCTION_ARGS)
Datum date_timestamptz(PG_FUNCTION_ARGS)
Datum time_gt(PG_FUNCTION_ARGS)
Datum date_larger(PG_FUNCTION_ARGS)
Datum date_pli(PG_FUNCTION_ARGS)
Datum date_gt_timestamp(PG_FUNCTION_ARGS)
Datum timetypmodin(PG_FUNCTION_ARGS)
Datum time_mi_interval(PG_FUNCTION_ARGS)
Datum date_send(PG_FUNCTION_ARGS)
Datum timestamptz_gt_date(PG_FUNCTION_ARGS)