|
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 1741 of file date.c.
References INT64CONST, and 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 73 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 753 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, and USECS_PER_DAY.
Referenced by convert_timevalue_to_scalar().
Definition at line 630 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, ereturn, errcode(), errmsg(), POSTGRES_EPOCH_JDATE, TIMESTAMP_END_JULIAN, TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, and USECS_PER_DAY.
Referenced by cvt_date_timestamp(), date2timestamp(), and date_cmp_timestamp_internal().
| TimestampTz date2timestamptz_safe | ( | DateADT | dateVal, |
| Node * | escontext | ||
| ) |
Definition at line 679 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, DetermineTimeZoneOffset(), ereturn, errcode(), errmsg(), 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 cvt_date_timestamptz(), date2timestamptz(), and date_cmp_timestamptz_internal().
Definition at line 776 of file date.c.
References Assert(), date2timestamp_safe(), ErrorSaveContext::error_occurred, 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 857 of file date.c.
References date2timestamptz_safe(), ErrorSaveContext::error_occurred, 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 cvt_timestamp_date(), cvt_timestamptz_date(), date_decrement(), date_increment(), date_skipsupport(), daterange_canonical(), ExecEvalSQLValueFunction(), gbt_date_penalty(), gbt_date_ssup_cmp(), 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(), cvt_date_timestamp(), cvt_date_timestamptz(), date_decrement(), date_increment(), 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 303 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 1547 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 318 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 351 of file date.c.
References AdjustTimeForTypmod(), GetCurrentTimeUsec(), palloc(), TimeTzADT::time, tm, and tm2timetz().
Referenced by ExecEvalSQLValueFunction().
Definition at line 371 of file date.c.
References AdjustTimeForTypmod(), GetCurrentTimeUsec(), tm, and tm2time().
Referenced by ExecEvalSQLValueFunction().
Definition at line 1584 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().
| bool time_overflows | ( | int | hour, |
| int | min, | ||
| int | sec, | ||
| fsec_t | fsec | ||
| ) |
Definition at line 1523 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(), gbt_time_dist(), gbt_time_penalty(), gbt_timeeq(), gbt_timege(), gbt_timegt(), gbt_timekey_cmp(), gbt_timekey_ssup_cmp(), gbt_timele(), gbt_timelt(), leftmostvalue_time(), and parse_datetime().
Definition at line 1358 of file date.c.
References date2j(), DATE_NOBEGIN, DATE_NOEND, ereturn, errcode(), errmsg(), POSTGRES_EPOCH_JDATE, timestamp2tm(), TIMESTAMP_IS_NOBEGIN, TIMESTAMP_IS_NOEND, tm, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Referenced by cvt_timestamp_date(), and timestamp_date().
| DateADT timestamptz2date_safe | ( | TimestampTz | timestamp, |
| Node * | escontext | ||
| ) |
Definition at line 1432 of file date.c.
References date2j(), DATE_NOBEGIN, DATE_NOEND, ereturn, errcode(), errmsg(), POSTGRES_EPOCH_JDATE, timestamp2tm(), TIMESTAMP_IS_NOBEGIN, TIMESTAMP_IS_NOEND, tm, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Referenced by cvt_timestamptz_date(), and timestamptz_date().
Definition at line 2499 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 1512 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 2359 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().