PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | TimeTzADT |
Macros | |
#define | DATEVAL_NOBEGIN ((DateADT) PG_INT32_MIN) |
#define | DATEVAL_NOEND ((DateADT) PG_INT32_MAX) |
#define | DATE_NOBEGIN(j) ((j) = DATEVAL_NOBEGIN) |
#define | DATE_IS_NOBEGIN(j) ((j) == DATEVAL_NOBEGIN) |
#define | DATE_NOEND(j) ((j) = DATEVAL_NOEND) |
#define | DATE_IS_NOEND(j) ((j) == DATEVAL_NOEND) |
#define | DATE_NOT_FINITE(j) (DATE_IS_NOBEGIN(j) || DATE_IS_NOEND(j)) |
#define | MAX_TIME_PRECISION 6 |
#define | PG_GETARG_DATEADT(n) DatumGetDateADT(PG_GETARG_DATUM(n)) |
#define | PG_GETARG_TIMEADT(n) DatumGetTimeADT(PG_GETARG_DATUM(n)) |
#define | PG_GETARG_TIMETZADT_P(n) DatumGetTimeTzADTP(PG_GETARG_DATUM(n)) |
#define | PG_RETURN_DATEADT(x) return DateADTGetDatum(x) |
#define | PG_RETURN_TIMEADT(x) return TimeADTGetDatum(x) |
#define | PG_RETURN_TIMETZADT_P(x) return TimeTzADTPGetDatum(x) |
Typedefs | |
typedef int32 | DateADT |
typedef int64 | TimeADT |
#define DATE_IS_NOBEGIN | ( | j | ) | ((j) == DATEVAL_NOBEGIN) |
#define DATE_IS_NOEND | ( | j | ) | ((j) == DATEVAL_NOEND) |
#define DATE_NOBEGIN | ( | j | ) | ((j) = DATEVAL_NOBEGIN) |
#define DATE_NOEND | ( | j | ) | ((j) = DATEVAL_NOEND) |
#define DATE_NOT_FINITE | ( | j | ) | (DATE_IS_NOBEGIN(j) || DATE_IS_NOEND(j)) |
#define DATEVAL_NOBEGIN ((DateADT) PG_INT32_MIN) |
#define DATEVAL_NOEND ((DateADT) PG_INT32_MAX) |
#define PG_GETARG_DATEADT | ( | n | ) | DatumGetDateADT(PG_GETARG_DATUM(n)) |
#define PG_GETARG_TIMEADT | ( | n | ) | DatumGetTimeADT(PG_GETARG_DATUM(n)) |
#define PG_GETARG_TIMETZADT_P | ( | n | ) | DatumGetTimeTzADTP(PG_GETARG_DATUM(n)) |
#define PG_RETURN_DATEADT | ( | x | ) | return DateADTGetDatum(x) |
#define PG_RETURN_TIMEADT | ( | x | ) | return TimeADTGetDatum(x) |
#define PG_RETURN_TIMETZADT_P | ( | x | ) | return TimeTzADTPGetDatum(x) |
Definition at line 1657 of file date.c.
References MAX_TIME_PRECISION.
Referenced by executeDateTimeMethod(), GetSQLCurrentTime(), GetSQLLocalTime(), parse_datetime(), time_in(), time_recv(), time_scale(), timetz_in(), timetz_recv(), and timetz_scale().
Definition at line 71 of file date.c.
References ereport, errcode(), errmsg(), ERROR, MAX_TIME_PRECISION, and WARNING.
Referenced by anytime_typmodin(), executeDateTimeMethod(), and transformSQLValueFunction().
double date2timestamp_no_overflow | ( | DateADT | dateVal | ) |
Definition at line 732 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, and USECS_PER_DAY.
Referenced by convert_timevalue_to_scalar().
Definition at line 576 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, ereport, errcode(), errmsg(), ERROR, POSTGRES_EPOCH_JDATE, TIMESTAMP_END_JULIAN, TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, and USECS_PER_DAY.
Referenced by date2timestamp(), and date_cmp_timestamp_internal().
TimestampTz date2timestamptz_opt_overflow | ( | DateADT | dateVal, |
int * | overflow | ||
) |
Definition at line 636 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, DetermineTimeZoneOffset(), ereport, errcode(), errmsg(), ERROR, IS_VALID_TIMESTAMP, j2date(), MIN_TIMESTAMP, POSTGRES_EPOCH_JDATE, session_timezone, TIMESTAMP_END_JULIAN, TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, tm, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_year, USECS_PER_DAY, and USECS_PER_SEC.
Referenced by date2timestamptz(), and date_cmp_timestamptz_internal().
Definition at line 755 of file date.c.
References Assert, date2timestamp_opt_overflow(), timestamp_cmp_internal(), and TIMESTAMP_IS_NOEND.
Referenced by cmpDateToTimestamp(), date_cmp_timestamp(), date_eq_timestamp(), date_ge_timestamp(), date_gt_timestamp(), date_le_timestamp(), date_lt_timestamp(), date_ne_timestamp(), timestamp_cmp_date(), timestamp_eq_date(), timestamp_ge_date(), timestamp_gt_date(), timestamp_le_date(), timestamp_lt_date(), and timestamp_ne_date().
int32 date_cmp_timestamptz_internal | ( | DateADT | dateVal, |
TimestampTz | dt2 | ||
) |
Definition at line 835 of file date.c.
References date2timestamptz_opt_overflow(), TIMESTAMP_IS_NOBEGIN, TIMESTAMP_IS_NOEND, and timestamptz_cmp_internal.
Referenced by cmpDateToTimestampTz(), date_cmp_timestamptz(), date_eq_timestamptz(), date_ge_timestamptz(), date_gt_timestamptz(), date_le_timestamptz(), date_lt_timestamptz(), date_ne_timestamptz(), timestamptz_cmp_date(), timestamptz_eq_date(), timestamptz_ge_date(), timestamptz_gt_date(), timestamptz_le_date(), timestamptz_lt_date(), and timestamptz_ne_date().
Definition at line 72 of file date.h.
References Int32GetDatum().
Referenced by daterange_canonical(), ExecEvalSQLValueFunction(), gbt_date_penalty(), gbt_dateeq(), gbt_datege(), gbt_dategt(), gbt_datekey_cmp(), gbt_datele(), gbt_datelt(), gbt_num_fetch(), gdb_date_dist(), leftmostvalue_date(), and parse_datetime().
Definition at line 54 of file date.h.
References DatumGetInt32().
Referenced by compareDatetime(), convert_timevalue_to_scalar(), daterange_canonical(), executeDateTimeMethod(), gbt_num_compress(), JsonEncodeDateTime(), and map_sql_value_to_xml_value().
Definition at line 60 of file date.h.
References DatumGetInt64().
Referenced by convert_timevalue_to_scalar(), executeDateTimeMethod(), gbt_num_compress(), and JsonEncodeDateTime().
Definition at line 66 of file date.h.
References DatumGetPointer().
Referenced by convert_timevalue_to_scalar(), executeDateTimeMethod(), gbt_timetz_compress(), and JsonEncodeDateTime().
void EncodeSpecialDate | ( | DateADT | dt, |
char * | str | ||
) |
Definition at line 294 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, EARLY, elog, ERROR, LATE, and str.
Referenced by date_out(), and JsonEncodeDateTime().
bool float_time_overflows | ( | int | hour, |
int | min, | ||
double | sec | ||
) |
Definition at line 1463 of file date.c.
References HOURS_PER_DAY, MINS_PER_HOUR, SECS_PER_MINUTE, USECS_PER_DAY, and USECS_PER_SEC.
Referenced by make_time(), and make_timestamp_internal().
DateADT GetSQLCurrentDate | ( | void | ) |
Definition at line 309 of file date.c.
References date2j(), GetCurrentDateTime(), POSTGRES_EPOCH_JDATE, tm, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Referenced by ExecEvalSQLValueFunction().
Definition at line 342 of file date.c.
References AdjustTimeForTypmod(), GetCurrentTimeUsec(), palloc(), TimeTzADT::time, tm, and tm2timetz().
Referenced by ExecEvalSQLValueFunction().
Definition at line 362 of file date.c.
References AdjustTimeForTypmod(), GetCurrentTimeUsec(), tm, and tm2time().
Referenced by ExecEvalSQLValueFunction().
Definition at line 1500 of file date.c.
References tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by JsonEncodeDateTime(), time_out(), time_part_common(), and time_timetz().
Definition at line 1439 of file date.c.
References HOURS_PER_DAY, MINS_PER_HOUR, SECS_PER_MINUTE, USECS_PER_DAY, and USECS_PER_SEC.
Referenced by DecodeDateTime(), and DecodeTimeOnly().
Definition at line 78 of file date.h.
References Int64GetDatum().
Referenced by ExecEvalSQLValueFunction(), executeDateTimeMethod(), gbt_num_fetch(), leftmostvalue_time(), and parse_datetime().
Definition at line 2415 of file date.c.
References TimeTzADT::time, tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, USECS_PER_HOUR, USECS_PER_MINUTE, USECS_PER_SEC, and TimeTzADT::zone.
Referenced by JsonEncodeDateTime(), timetz_out(), and timetz_part_common().
Definition at line 84 of file date.h.
References PointerGetDatum().
Referenced by ExecEvalSQLValueFunction(), executeDateTimeMethod(), leftmostvalue_timetz(), and parse_datetime().
Definition at line 1428 of file date.c.
References MINS_PER_HOUR, SECS_PER_MINUTE, tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, and USECS_PER_SEC.
Referenced by GetSQLLocalTime(), parse_datetime(), and time_in().
Definition at line 2275 of file date.c.
References MINS_PER_HOUR, SECS_PER_MINUTE, TimeTzADT::time, tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, USECS_PER_SEC, and TimeTzADT::zone.
Referenced by GetSQLCurrentTime(), parse_datetime(), timestamptz_timetz(), and timetz_in().