|
PostgreSQL Source Code git master
|


Go to the source code of this file.
Data Structures | |
| struct | datetkn |
Typedefs | |
| typedef int32 | fsec_t |
Variables | |
| char * | pgtypes_date_weekdays_short [] |
| char * | pgtypes_date_months [] |
| char * | months [] |
| char * | days [] |
| const int | day_tab [2][13] |
| #define DT_NOBEGIN (-INT64CONST(0x7fffffffffffffff) - 1) |
| #define DT_NOEND (INT64CONST(0x7fffffffffffffff)) |
| #define DTK_ALL_SECS_M (DTK_M(SECOND) | DTK_M(MILLISECOND) | DTK_M(MICROSECOND)) |
| #define END_TIMESTAMP INT64CONST(9223371331200000000) |
| #define FMODULO | ( | t, | |
| q, | |||
| u | |||
| ) |
| #define IS_VALID_TIMESTAMP | ( | t | ) | (MIN_TIMESTAMP <= (t) && (t) < END_TIMESTAMP) |
| #define MIN_TIMESTAMP INT64CONST(-211813488000000000) |
| #define SECS_PER_YEAR (36525 * 864) /* avoid floating-point computation */ |
| #define TIMESTAMP_NOT_FINITE | ( | j | ) | (TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j)) |
| #define TMODULO | ( | t, | |
| q, | |||
| u | |||
| ) |
| #define TZ 5 /* fixed-offset timezone abbreviation */ |
| #define USECS_PER_DAY INT64CONST(86400000000) |
| #define USECS_PER_HOUR INT64CONST(3600000000) |
| #define USECS_PER_MINUTE INT64CONST(60000000) |
| #define USECS_PER_SEC INT64CONST(1000000) |
Definition at line 4933 of file datetime.c.
References Assert, CheckDateTokenTable(), date2j(), datetktbl, deltatktbl, fb(), POSTGRES_EPOCH_JDATE, szdatetktbl, szdeltatktbl, and UNIX_EPOCH_JDATE.
Referenced by PostmasterMain().
Definition at line 296 of file datetime.c.
Referenced by CheckDateTokenTables(), date2isoweek(), date2isoyear(), date2isoyearday(), date_in(), DCH_to_char(), DecodeDateTime(), DecodeDateTime(), DecodeNumber(), DetermineTimeZoneOffsetInternal(), EncodeDateTime(), EncodeDateTime(), extract_date(), GetSQLCurrentDate(), isoweek2j(), make_date(), make_timestamp_internal(), parse_datetime(), PGTYPESdate_dayofweek(), PGTYPESdate_defmt_asc(), PGTYPESdate_fmt_asc(), PGTYPESdate_from_asc(), PGTYPESdate_julmdy(), PGTYPESdate_mdyjul(), PGTYPESdate_to_asc(), PGTYPESdate_today(), timestamp2date_safe(), timestamp2tm(), timestamp_part_common(), timestamp_pl_interval(), timestamp_to_char(), timestamptz2date_safe(), timestamptz_part_common(), timestamptz_pl_interval_internal(), timestamptz_to_char(), tm2timestamp(), tm2timestamp(), to_date(), and ValidateDate().
| int DecodeDateTime | ( | char ** | field, |
| int * | ftype, | ||
| int | nf, | ||
| int * | dtype, | ||
| struct tm * | tm, | ||
| fsec_t * | fsec, | ||
| bool | EuroDates | ||
| ) |
Definition at line 1782 of file dt_common.c.
References ADBC, AM, AMPM, BC, date2j(), DAY, day_tab, DecodeDate(), DecodeNumber(), DecodeNumberField(), DecodePosixTimezone(), DecodeSpecial(), DecodeTime(), DecodeTimezone(), DOW, dt2time(), DTK_DATE, DTK_DATE_M, DTK_DAY, DTK_HOUR, DTK_JULIAN, DTK_M, DTK_MINUTE, DTK_MONTH, DTK_NOW, DTK_NUMBER, DTK_SECOND, DTK_SPECIAL, DTK_STRING, DTK_TIME, DTK_TIME_M, DTK_TODAY, DTK_TOMORROW, DTK_TZ, DTK_YEAR, DTK_YESTERDAY, DTK_ZULU, DTZ, DTZMOD, fb(), GetCurrentDateTime(), HOUR, HR24, i, IGNORE_DTF, isleap, ISOTIME, j2date(), MINUTE, MONTH, PM, RESERV, SECOND, strtoint(), tm, pg_tm::tm_hour, pg_tm::tm_isdst, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_wday, pg_tm::tm_year, type, TZ, UNITS, USECS_PER_DAY, val, value, and YEAR.
| int DecodeInterval | ( | char ** | field, |
| int * | ftype, | ||
| int | nf, | ||
| int * | dtype, | ||
| struct tm * | tm, | ||
| fsec_t * | fsec | ||
| ) |
Definition at line 326 of file interval.c.
References AdjustFractDays(), AdjustFractSeconds(), AGO, Assert, ClearPgTm(), DAY, DAYS_PER_MONTH, DecodeTime(), DecodeUnits(), DTERR_BAD_FORMAT, DTERR_FIELD_OVERFLOW, DTK_ALL_SECS_M, DTK_CENTURY, DTK_DATE, DTK_DATE_M, DTK_DAY, DTK_DECADE, DTK_DELTA, DTK_HOUR, DTK_M, DTK_MICROSEC, DTK_MILLENNIUM, DTK_MILLISEC, DTK_MINUTE, DTK_MONTH, DTK_NUMBER, DTK_SECOND, DTK_SPECIAL, DTK_STRING, DTK_TIME, DTK_TIME_M, DTK_TZ, DTK_WEEK, DTK_YEAR, fb(), HOUR, i, IGNORE_DTF, INTERVAL_FULL_RANGE, INTERVAL_MASK, IntervalStyle, INTSTYLE_POSTGRES_VERBOSE, INTSTYLE_SQL_STANDARD, MICROSECOND, MILLISECOND, MINUTE, MONTH, MONTHS_PER_YEAR, range(), RESERV, SECOND, SECS_PER_DAY, SECS_PER_HOUR, SECS_PER_MINUTE, strtoint(), 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, type, TZ, UNITS, USECS_PER_SEC, val, and YEAR.
Referenced by PGTYPESinterval_from_asc().
Definition at line 1437 of file dt_common.c.
References DTK_TIME_M, fb(), i, str, strtoint(), tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, and USECS_PER_SEC.
Referenced by DecodeDateTime().
Definition at line 536 of file dt_common.c.
References datebsearch(), deltacache, deltatktbl, fb(), szdeltatktbl, TOKMAXLEN, type, datetkn::type, UNKNOWN_FIELD, val, and datetkn::value.
Definition at line 1068 of file dt_common.c.
References fb(), USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by DecodeDateTime().
Definition at line 669 of file dt_common.c.
References Assert, fb(), MONTHS_PER_YEAR, sprintf, str, tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_year, USE_GERMAN_DATES, USE_ISO_DATES, USE_POSTGRES_DATES, and USE_SQL_DATES.
| void EncodeDateTime | ( | struct tm * | tm, |
| fsec_t | fsec, | ||
| bool | print_tz, | ||
| int | tz, | ||
| const char * | tzn, | ||
| int | style, | ||
| char * | str, | ||
| bool | EuroDates | ||
| ) |
Definition at line 753 of file dt_common.c.
References date2j(), days, fb(), MAXTZLEN, MINS_PER_HOUR, months, SECS_PER_HOUR, sprintf, str, tm, pg_tm::tm_hour, pg_tm::tm_isdst, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_wday, pg_tm::tm_year, TrimTrailingZeros(), USE_GERMAN_DATES, USE_ISO_DATES, USE_POSTGRES_DATES, and USE_SQL_DATES.
Definition at line 759 of file interval.c.
References AddISO8601IntPart(), AddPostgresIntPart(), AddVerboseIntPart(), AppendSeconds(), fb(), INTSTYLE_ISO_8601, INTSTYLE_POSTGRES, INTSTYLE_POSTGRES_VERBOSE, INTSTYLE_SQL_STANDARD, MAX_INTERVAL_PRECISION, sprintf, str, tm, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, and pg_tm::tm_year.
Referenced by PGTYPESinterval_to_asc().
Definition at line 1060 of file dt_common.c.
References abstime2tm(), fb(), and tm.
Referenced by DecodeDateTime().
Definition at line 949 of file dt_common.c.
References epoch, fb(), tm, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, and pg_tm::tm_year.
Definition at line 321 of file datetime.c.
References fb(), MONTHS_PER_YEAR, and y.
Referenced by date2timestamptz_safe(), date_out(), DecodeDateTime(), DecodeDateTime(), DecodeNumber(), DecodeTimeOnly(), do_to_timestamp(), executeDateTimeMethod(), extract_date(), isoweek2date(), isoweekdate2date(), JsonEncodeDateTime(), map_sql_value_to_xml_value(), PGTYPESdate_fmt_asc(), PGTYPESdate_julmdy(), PGTYPESdate_to_asc(), timestamp2tm(), timestamp2tm(), timestamp_pl_interval(), timestamptz_pl_interval_internal(), and ValidateDate().
| int ParseDateTime | ( | char * | timestr, |
| char * | lowstr, | ||
| char ** | field, | ||
| int * | ftype, | ||
| int * | numfields, | ||
| char ** | endstr | ||
| ) |
Definition at line 1600 of file dt_common.c.
References DTK_DATE, DTK_NUMBER, DTK_SPECIAL, DTK_STRING, DTK_TIME, DTK_TZ, fb(), MAXDATEFIELDS, and pg_tolower().
| int PGTYPEStimestamp_defmt_scan | ( | char ** | str, |
| char * | fmt, | ||
| timestamp * | d, | ||
| int * | year, | ||
| int * | month, | ||
| int * | day, | ||
| int * | hour, | ||
| int * | minute, | ||
| int * | second, | ||
| int * | tz | ||
| ) |
Definition at line 2521 of file dt_common.c.
References datetktbl, day_tab, days, DecodeTimezone(), DTZ, err(), fb(), free, isleap, j, months, MONTHS_PER_YEAR, pg_strcasecmp(), pgtypes_alloc(), pgtypes_date_months, pgtypes_date_weekdays_short, pgtypes_defmt_scan(), PGTYPES_TYPE_STRING_MALLOCED, PGTYPES_TYPE_UINT, PGTYPES_TYPE_UINT_LONG, PGTYPEStimestamp_defmt_scan(), str, szdatetktbl, tm, tm2timestamp(), pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_year, type, TZ, and datetkn::value.
Referenced by PGTYPEStimestamp_defmt_asc(), and PGTYPEStimestamp_defmt_scan().
Definition at line 41 of file timestamp.c.
References date2j(), dt2local(), fb(), IS_VALID_JULIAN, IS_VALID_TIMESTAMP, pg_add_s64_overflow(), pg_mul_s64_overflow(), time2t(), 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, unlikely, and USECS_PER_DAY.
Definition at line 722 of file dt_common.c.
References fb(), len, and str.
Referenced by AppendSeconds(), and EncodeDateTime().
Definition at line 75 of file datetime.c.
Referenced by DecodeDateTime(), PGTYPEStimestamp_add_interval(), PGTYPEStimestamp_defmt_scan(), timestamp_age(), timestamp_pl_interval(), timestamptz_age(), timestamptz_pl_interval_internal(), and ValidateDate().
|
extern |
Definition at line 84 of file datetime.c.
Referenced by AdjustDays(), brin_minmax_multi_distance_interval(), date_mii(), date_pli(), DCH_from_char(), DCH_to_char(), dttofmtasc_replace(), EncodeDateTime(), EncodeDateTime(), interval_cmp_value(), make_interval(), PGTYPEStimestamp_defmt_scan(), and PrintTiming().
|
extern |
Definition at line 81 of file datetime.c.
Referenced by DCH_from_char(), DCH_to_char(), dttofmtasc_replace(), EncodeDateTime(), EncodeDateTime(), make_interval(), PGTYPESdate_defmt_asc(), PGTYPESdate_fmt_asc(), and PGTYPEStimestamp_defmt_scan().
|
extern |
Definition at line 499 of file dt_common.c.
Referenced by dttofmtasc_replace(), PGTYPESdate_defmt_asc(), and PGTYPEStimestamp_defmt_scan().
|
extern |
Definition at line 497 of file dt_common.c.
Referenced by dttofmtasc_replace(), PGTYPESdate_fmt_asc(), and PGTYPEStimestamp_defmt_scan().