|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <ctype.h>#include <limits.h>#include <math.h>#include "access/htup_details.h"#include "access/xact.h"#include "common/int.h"#include "common/string.h"#include "funcapi.h"#include "miscadmin.h"#include "nodes/nodeFuncs.h"#include "parser/scansup.h"#include "utils/builtins.h"#include "utils/date.h"#include "utils/datetime.h"#include "utils/guc.h"#include "utils/tzparser.h"
Go to the source code of this file.
Data Structures | |
| struct | TzAbbrevCache |
Macros | |
| #define | APPEND_CHAR(bufptr, end, newchar) |
Typedefs | |
| typedef struct TzAbbrevCache | TzAbbrevCache |
Variables | |
| const int | day_tab [2][13] |
| const char *const | months [] |
| const char *const | days [] |
| static const datetkn | datetktbl [] |
| static const int | szdatetktbl = sizeof datetktbl / sizeof datetktbl[0] |
| static const datetkn | deltatktbl [] |
| static const int | szdeltatktbl = sizeof deltatktbl / sizeof deltatktbl[0] |
| static TimeZoneAbbrevTable * | zoneabbrevtbl = NULL |
| static const datetkn * | datecache [MAXDATEFIELDS] = {NULL} |
| static const datetkn * | deltacache [MAXDATEFIELDS] = {NULL} |
| static TzAbbrevCache | tzabbrevcache [MAXDATEFIELDS] |
Definition at line 4635 of file datetime.c.
References fb(), sprintf, and value.
Referenced by EncodeInterval().
|
static |
Definition at line 4645 of file datetime.c.
References fb(), sprintf, and value.
Referenced by EncodeInterval().
|
static |
Definition at line 4668 of file datetime.c.
References fb(), sprintf, and value.
Referenced by EncodeInterval().
Definition at line 643 of file datetime.c.
References days, fb(), pg_add_s32_overflow(), pg_mul_s32_overflow(), scale, and val.
Referenced by DecodeInterval(), and DecodeISO8601Interval().
Definition at line 579 of file datetime.c.
References AdjustFractMicroseconds(), fb(), pg_add_s32_overflow(), scale, and USECS_PER_DAY.
Referenced by DecodeInterval(), and DecodeISO8601Interval().
Definition at line 547 of file datetime.c.
References fb(), pg_add_s64_overflow(), and scale.
Referenced by AdjustFractDays(), AdjustMicroseconds(), DecodeInterval(), and DecodeISO8601Interval().
Definition at line 611 of file datetime.c.
References fb(), MONTHS_PER_YEAR, pg_add_s32_overflow(), and scale.
Referenced by DecodeInterval(), and DecodeISO8601Interval().
|
static |
Definition at line 628 of file datetime.c.
References AdjustFractMicroseconds(), fb(), int64_multiply_add(), scale, and val.
Referenced by DecodeInterval(), and DecodeISO8601Interval().
Definition at line 659 of file datetime.c.
References fb(), pg_add_s32_overflow(), and val.
Referenced by DecodeInterval(), and DecodeISO8601Interval().
Definition at line 671 of file datetime.c.
References fb(), pg_add_s32_overflow(), pg_mul_s32_overflow(), scale, and val.
Referenced by DecodeInterval(), and DecodeISO8601Interval().
|
static |
Definition at line 458 of file datetime.c.
References Assert, fb(), pg_ultostr(), pg_ultostr_zeropad(), remainder, and value.
Referenced by AppendTimestampSeconds(), EncodeInterval(), and EncodeTimeOnly().
Definition at line 521 of file datetime.c.
References AppendSeconds(), fb(), MAX_TIMESTAMP_PRECISION, tm, and pg_tm::tm_sec.
Referenced by EncodeDateTime().
Definition at line 4901 of file datetime.c.
References elog, fb(), i, LOG, and TOKMAXLEN.
Referenced by CheckDateTokenTables(), and ConvertTimeZoneAbbrevs().
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 3462 of file datetime.c.
References fb().
Referenced by DecodeInterval(), and DecodeISO8601Interval().
Definition at line 3227 of file datetime.c.
References fb(), and tzabbrevcache.
Referenced by assign_timezone().
| TimeZoneAbbrevTable * ConvertTimeZoneAbbrevs | ( | struct tzEntry * | abbrevs, |
| int | n | ||
| ) |
Definition at line 4995 of file datetime.c.
References Assert, CheckDateTokenTable(), DTZ, DYNTZ, fb(), guc_malloc(), i, LOG, MAXALIGN, strlcpy(), TOKMAXLEN, TZ, and DynamicZoneAbbrev::tz.
Referenced by load_tzoffsets().
Definition at line 296 of file datetime.c.
References fb().
Referenced by CheckDateTokenTables(), date2isoweek(), date2isoyear(), date2isoyearday(), date_in(), DCH_to_char(), DecodeDateTime(), DetermineTimeZoneOffsetInternal(), 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().
Definition at line 4275 of file datetime.c.
References fb(), and TOKMAXLEN.
Referenced by DecodeSpecial(), DecodeTimezoneAbbrev(), DecodeTimezoneAbbrevPrefix(), DecodeUnits(), and ParseDateTime().
| void DateTimeParseError | ( | int | dterr, |
| DateTimeErrorExtra * | extra, | ||
| const char * | str, | ||
| const char * | datatype, | ||
| Node * | escontext | ||
| ) |
Definition at line 4214 of file datetime.c.
References DateTimeErrorExtra::dtee_abbrev, DateTimeErrorExtra::dtee_timezone, DTERR_BAD_FORMAT, DTERR_BAD_TIMEZONE, DTERR_BAD_ZONE_ABBREV, DTERR_FIELD_OVERFLOW, DTERR_INTERVAL_OVERFLOW, DTERR_MD_FIELD_OVERFLOW, DTERR_TZDISP_OVERFLOW, errcode(), errdetail(), errhint(), errmsg(), errsave, fb(), and str.
Referenced by date_in(), DecodeTimezoneName(), do_to_timestamp(), interval_in(), pg_timezone_abbrevs_abbrevs(), time_in(), timestamp_in(), timestamptz_in(), and timetz_in().
|
static |
Definition at line 2451 of file datetime.c.
References DecodeNumber(), DecodeSpecial(), DOY, DTERR_BAD_FORMAT, DTK_DATE_M, DTK_M, fb(), i, IGNORE_DTF, len, MAXDATEFIELDS, MONTH, str, tm, pg_tm::tm_mon, type, TZ, and val.
Referenced by DecodeDateTime(), and DecodeTimeOnly().
| int DecodeDateTime | ( | char ** | field, |
| int * | ftype, | ||
| int | nf, | ||
| int * | dtype, | ||
| struct pg_tm * | tm, | ||
| fsec_t * | fsec, | ||
| int * | tzp, | ||
| DateTimeErrorExtra * | extra | ||
| ) |
Definition at line 997 of file datetime.c.
References ADBC, AM, AMPM, BC, date2j(), DAY, DecodeDate(), DecodeNumber(), DecodeNumberField(), DecodeSpecial(), DecodeTime(), DecodeTimezone(), DecodeTimezoneAbbrev(), DetermineTimeZoneAbbrevOffset(), DetermineTimeZoneOffset(), DOW, dt2time(), DateTimeErrorExtra::dtee_timezone, DTERR_BAD_FORMAT, DTERR_BAD_TIMEZONE, DTERR_FIELD_OVERFLOW, DTK_DATE, DTK_DATE_M, DTK_EARLY, DTK_EPOCH, DTK_JULIAN, DTK_LATE, DTK_M, DTK_NOW, DTK_NUMBER, DTK_SPECIAL, DTK_STRING, DTK_TIME, DTK_TIME_M, DTK_TODAY, DTK_TOMORROW, DTK_TZ, DTK_YESTERDAY, DTK_ZULU, DTZ, DTZMOD, DYNTZ, elog, ERROR, fb(), GetCurrentDateTime(), GetCurrentTimeUsec(), HOURS_PER_DAY, HR24, i, IGNORE_DTF, INTERVAL_FULL_RANGE, ISOTIME, j2date(), MONTH, ParseFraction(), pg_tzset(), PM, RESERV, session_timezone, strtoint(), time_overflows(), 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, UNKNOWN_FIELD, USECS_PER_DAY, val, ValidateDate(), and value.
Referenced by check_recovery_target_time(), date_in(), PGTYPESdate_from_asc(), PGTYPEStimestamp_from_asc(), timestamp_in(), and timestamptz_in().
| int DecodeInterval | ( | char ** | field, |
| int * | ftype, | ||
| int | nf, | ||
| int | range, | ||
| int * | dtype, | ||
| struct pg_itm_in * | itm_in | ||
| ) |
Definition at line 3486 of file datetime.c.
References AdjustDays(), AdjustFractDays(), AdjustFractMicroseconds(), AdjustFractYears(), AdjustMicroseconds(), AdjustMonths(), AdjustYears(), AGO, Assert, CENTURY, ClearPgItmIn(), DAY, DAYS_PER_MONTH, DECADE, DecodeSpecial(), DecodeTimeForInterval(), 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_EARLY, DTK_HOUR, DTK_LATE, 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_MASK, IntervalStyle, INTSTYLE_SQL_STANDARD, MICROSECOND, MILLENNIUM, MILLISECOND, MINUTE, MONTH, MONTHS_PER_YEAR, ParseFraction(), pg_add_s64_overflow(), PG_INT64_MIN, pg_mul_s64_overflow(), range(), RESERV, SECOND, strtoint(), type, UNITS, UNKNOWN_FIELD, USECS_PER_DAY, USECS_PER_HOUR, USECS_PER_MINUTE, USECS_PER_SEC, val, WEEK, and YEAR.
Referenced by interval_in().
Definition at line 3951 of file datetime.c.
References AdjustDays(), AdjustFractDays(), AdjustFractMicroseconds(), AdjustFractYears(), AdjustMicroseconds(), AdjustMonths(), AdjustYears(), ClearPgItmIn(), DAYS_PER_MONTH, DTERR_BAD_FORMAT, DTERR_FIELD_OVERFLOW, DTK_DELTA, fb(), ISO8601IntegerWidth(), ParseISO8601Number(), str, USECS_PER_DAY, USECS_PER_HOUR, USECS_PER_MINUTE, USECS_PER_SEC, and val.
Referenced by interval_in().
|
static |
Definition at line 2780 of file datetime.c.
References DateOrder, DATEORDER_DMY, DATEORDER_YMD, DAY, DecodeNumberField(), DOY, DTERR_BAD_FORMAT, DTERR_FIELD_OVERFLOW, DTK_DATE_M, DTK_M, fb(), MONTH, ParseFractionalSecond(), str, strtoint(), tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_yday, pg_tm::tm_year, val, and YEAR.
Referenced by DecodeDate(), DecodeDateTime(), and DecodeTimeOnly().
|
static |
Definition at line 2965 of file datetime.c.
References DTERR_BAD_FORMAT, DTK_DATE, DTK_DATE_M, DTK_TIME, DTK_TIME_M, fb(), len, ParseFractionalSecond(), 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 DecodeDateTime(), DecodeNumber(), and DecodeTimeOnly().
Definition at line 3246 of file datetime.c.
References datebsearch(), datecache, datetktbl, fb(), szdatetktbl, datetkn::token, TOKMAXLEN, type, datetkn::type, UNKNOWN_FIELD, val, and datetkn::value.
Referenced by DecodeDate(), DecodeDateTime(), DecodeInterval(), DecodeTimeOnly(), extract_date(), interval_part_common(), time_part_common(), timestamp_part_common(), timestamptz_part_common(), and timetz_part_common().
|
static |
Definition at line 2725 of file datetime.c.
References DecodeTimeCommon(), DTERR_FIELD_OVERFLOW, fb(), range(), str, tm, pg_tm::tm_hour, pg_tm::tm_min, and pg_tm::tm_sec.
Referenced by DecodeDateTime(), DecodeInterval(), and DecodeTimeOnly().
|
static |
Definition at line 2643 of file datetime.c.
References DTERR_BAD_FORMAT, DTERR_FIELD_OVERFLOW, DTK_TIME_M, fb(), INTERVAL_MASK, MINS_PER_HOUR, MINUTE, ParseFractionalSecond(), range(), SECOND, SECS_PER_MINUTE, str, strtoint(), and USECS_PER_SEC.
Referenced by DecodeTime(), and DecodeTimeForInterval().
|
static |
Definition at line 2754 of file datetime.c.
References DecodeTimeCommon(), DTERR_FIELD_OVERFLOW, fb(), int64_multiply_add(), range(), str, USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by DecodeInterval().
| int DecodeTimeOnly | ( | char ** | field, |
| int * | ftype, | ||
| int | nf, | ||
| int * | dtype, | ||
| struct pg_tm * | tm, | ||
| fsec_t * | fsec, | ||
| int * | tzp, | ||
| DateTimeErrorExtra * | extra | ||
| ) |
Definition at line 1917 of file datetime.c.
References ADBC, AM, AMPM, BC, DecodeDate(), DecodeNumber(), DecodeNumberField(), DecodeSpecial(), DecodeTime(), DecodeTimezone(), DecodeTimezoneAbbrev(), DetermineTimeZoneAbbrevOffset(), DetermineTimeZoneOffset(), dt2time(), DateTimeErrorExtra::dtee_timezone, DTERR_BAD_FORMAT, DTERR_BAD_TIMEZONE, DTERR_FIELD_OVERFLOW, DTK_DATE, DTK_DATE_M, DTK_JULIAN, DTK_M, DTK_NOW, DTK_NUMBER, DTK_SPECIAL, DTK_STRING, DTK_TIME, DTK_TIME_M, DTK_TZ, DTK_ZULU, DTZ, DTZMOD, DYNTZ, fb(), GetCurrentDateTime(), GetCurrentTimeUsec(), HOURS_PER_DAY, HR24, i, IGNORE_DTF, INTERVAL_FULL_RANGE, ISOTIME, j2date(), ParseFraction(), pg_get_timezone_offset(), pg_tzset(), PM, RESERV, session_timezone, strtoint(), time_overflows(), 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_year, type, TZ, UNITS, UNKNOWN_FIELD, USECS_PER_DAY, val, ValidateDate(), and value.
Referenced by time_in(), and timetz_in().
Definition at line 3057 of file datetime.c.
References DTERR_BAD_FORMAT, DTERR_TZDISP_OVERFLOW, fb(), MAX_TZDISP_HOUR, MINS_PER_HOUR, SECS_PER_MINUTE, str, and strtoint().
Referenced by DecodeDateTime(), DecodeTimeOnly(), and parse_sane_timezone().
| int DecodeTimezoneAbbrev | ( | int | field, |
| const char * | lowtoken, | ||
| int * | ftype, | ||
| int * | offset, | ||
| pg_tz ** | tz, | ||
| DateTimeErrorExtra * | extra | ||
| ) |
Definition at line 3141 of file datetime.c.
References TimeZoneAbbrevTable::abbrevs, datebsearch(), DTERR_BAD_ZONE_ABBREV, DTZ, DYNTZ, fb(), FetchDynamicTimeZone(), TimeZoneAbbrevTable::numabbrevs, session_timezone, strlcpy(), TimeZoneAbbrevIsKnown(), TOKMAXLEN, datetkn::type, TZ, tzabbrevcache, UNKNOWN_FIELD, datetkn::value, and zoneabbrevtbl.
Referenced by DecodeDateTime(), DecodeTimeOnly(), and DecodeTimezoneName().
Definition at line 3371 of file datetime.c.
References TimeZoneAbbrevTable::abbrevs, datebsearch(), DYNTZ, fb(), FetchDynamicTimeZone(), len, TimeZoneAbbrevTable::numabbrevs, pg_tolower(), session_timezone, str, TimeZoneAbbrevIsKnown(), TOKMAXLEN, datetkn::type, datetkn::value, and zoneabbrevtbl.
Referenced by DCH_from_char().
Definition at line 3288 of file datetime.c.
References DateTimeParseError(), DecodeTimezoneAbbrev(), downcase_truncate_identifier(), DTZ, DYNTZ, ereport, errcode(), errmsg(), ERROR, fb(), pg_tzset(), type, TZ, TZNAME_DYNTZ, TZNAME_FIXED_OFFSET, and TZNAME_ZONE.
Referenced by DecodeTimezoneNameToTz(), parse_sane_timezone(), timestamp_zone(), timestamptz_zone(), and timetz_zone().
Definition at line 3343 of file datetime.c.
References DecodeTimezoneName(), fb(), pg_tzset_offset(), and TZNAME_FIXED_OFFSET.
Referenced by lookup_timezone().
Definition at line 4169 of file datetime.c.
References datebsearch(), deltacache, deltatktbl, fb(), szdeltatktbl, datetkn::token, TOKMAXLEN, type, datetkn::type, UNKNOWN_FIELD, val, and datetkn::value.
Referenced by DecodeInterval(), DecodeInterval(), extract_date(), interval_part_common(), interval_trunc(), time_part_common(), timestamp_part_common(), timestamp_trunc(), timestamptz_part_common(), timestamptz_trunc_internal(), and timetz_part_common().
Definition at line 1765 of file datetime.c.
References DetermineTimeZoneAbbrevOffsetInternal(), DetermineTimeZoneOffsetInternal(), fb(), tm, and pg_tm::tm_isdst.
Referenced by DecodeDateTime(), DecodeTimeOnly(), do_to_timestamp(), parse_sane_timezone(), and timestamp_zone().
|
static |
Definition at line 1840 of file datetime.c.
References fb(), pg_interpret_timezone_abbrev(), pg_toupper(), strlcpy(), and TZ_STRLEN_MAX.
Referenced by DetermineTimeZoneAbbrevOffset(), and DetermineTimeZoneAbbrevOffsetTS().
Definition at line 1803 of file datetime.c.
References DetermineTimeZoneAbbrevOffsetInternal(), DetermineTimeZoneOffset(), ereport, errcode(), errmsg(), ERROR, fb(), timestamp2tm(), timestamptz_to_time_t(), tm, and pg_tm::tm_isdst.
Referenced by pg_timezone_abbrevs_abbrevs(), timestamptz_zone(), and timetz_zone().
Definition at line 1604 of file datetime.c.
References DetermineTimeZoneOffsetInternal(), and tm.
Referenced by date2timestamptz_safe(), DecodeDateTime(), DecodeTimeOnly(), DetermineTimeZoneAbbrevOffsetTS(), executeDateTimeMethod(), parse_sane_timezone(), time_timetz(), timestamp2timestamptz_safe(), timestamp_zone(), timestamptz_pl_interval_internal(), timestamptz_trunc_internal(), and to_timestamp().
|
static |
Definition at line 1626 of file datetime.c.
References date2j(), fb(), IS_VALID_JULIAN, MINS_PER_HOUR, pg_next_dst_boundary(), SECS_PER_DAY, SECS_PER_MINUTE, 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_year, and UNIX_EPOCH_JDATE.
Referenced by DetermineTimeZoneAbbrevOffset(), and DetermineTimeZoneOffset().
Definition at line 4349 of file datetime.c.
References Assert, DateOrder, DATEORDER_DMY, fb(), MONTHS_PER_YEAR, pg_ultostr_zeropad(), str, tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_year, USE_GERMAN_DATES, USE_ISO_DATES, USE_POSTGRES_DATES, USE_SQL_DATES, and USE_XSD_DATES.
Referenced by date_out(), JsonEncodeDateTime(), map_sql_value_to_xml_value(), and PGTYPESdate_to_asc().
| void EncodeDateTime | ( | struct pg_tm * | tm, |
| fsec_t | fsec, | ||
| bool | print_tz, | ||
| int | tz, | ||
| const char * | tzn, | ||
| int | style, | ||
| char * | str | ||
| ) |
Definition at line 4464 of file datetime.c.
References AppendTimestampSeconds(), Assert, date2j(), DateOrder, DATEORDER_DMY, days, EncodeTimezone(), fb(), j2day(), MAXTZLEN, months, MONTHS_PER_YEAR, pg_ultostr_zeropad(), 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_wday, pg_tm::tm_year, USE_GERMAN_DATES, USE_ISO_DATES, USE_POSTGRES_DATES, USE_SQL_DATES, and USE_XSD_DATES.
Referenced by JsonEncodeDateTime(), map_sql_value_to_xml_value(), PGTYPEStimestamp_to_asc(), timestamp_out(), timestamptz_out(), and timestamptz_to_str().
Definition at line 4707 of file datetime.c.
References AddISO8601IntPart(), AddPostgresIntPart(), AddVerboseIntPart(), AppendSeconds(), fb(), INTSTYLE_ISO_8601, INTSTYLE_POSTGRES, INTSTYLE_POSTGRES_VERBOSE, INTSTYLE_SQL_STANDARD, MAX_INTERVAL_PRECISION, sprintf, and str.
Referenced by interval_out().
| void EncodeTimeOnly | ( | struct pg_tm * | tm, |
| fsec_t | fsec, | ||
| bool | print_tz, | ||
| int | tz, | ||
| int | style, | ||
| char * | str | ||
| ) |
Definition at line 4434 of file datetime.c.
References AppendSeconds(), EncodeTimezone(), fb(), MAX_TIME_PRECISION, pg_ultostr_zeropad(), str, tm, pg_tm::tm_hour, pg_tm::tm_min, and pg_tm::tm_sec.
Referenced by JsonEncodeDateTime(), time_out(), and timetz_out().
Definition at line 4311 of file datetime.c.
References fb(), MINS_PER_HOUR, pg_ultostr_zeropad(), SECS_PER_MINUTE, str, and USE_XSD_DATES.
Referenced by EncodeDateTime(), and EncodeTimeOnly().
|
static |
Definition at line 5092 of file datetime.c.
References Assert, DateTimeErrorExtra::dtee_abbrev, DateTimeErrorExtra::dtee_timezone, DYNTZ, fb(), pg_tzset(), datetkn::token, datetkn::type, and datetkn::value.
Referenced by DecodeTimezoneAbbrev(), DecodeTimezoneAbbrevPrefix(), and pg_timezone_abbrevs_abbrevs().
Definition at line 376 of file datetime.c.
References fb(), GetCurrentTimeUsec(), and tm.
Referenced by DecodeDateTime(), DecodeTimeOnly(), GetSQLCurrentDate(), PGTYPESdate_today(), PGTYPEStimestamp_current(), and time_timetz().
Definition at line 397 of file datetime.c.
References ereport, errcode(), errmsg(), ERROR, fb(), GetCurrentTransactionStartTimestamp(), session_timezone, timestamp2tm(), and tm.
Referenced by DecodeDateTime(), DecodeTimeOnly(), GetCurrentDateTime(), GetSQLCurrentTime(), and GetSQLLocalTime().
| void InstallTimeZoneAbbrevs | ( | TimeZoneAbbrevTable * | tbl | ) |
Definition at line 5079 of file datetime.c.
References fb(), tzabbrevcache, and zoneabbrevtbl.
Referenced by assign_timezone_abbreviations().
Definition at line 532 of file datetime.c.
References fb(), pg_add_s64_overflow(), pg_mul_s64_overflow(), and val.
Referenced by AdjustMicroseconds(), and DecodeTimeForInterval().
Definition at line 3924 of file datetime.c.
References fb().
Referenced by DecodeISO8601Interval().
Definition at line 321 of file datetime.c.
References fb(), MONTHS_PER_YEAR, and y.
Referenced by date2timestamptz_safe(), date_out(), DecodeDateTime(), 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().
Definition at line 354 of file datetime.c.
Referenced by date2isoweek(), date2isoyear(), EncodeDateTime(), extract_date(), isoweek2j(), timestamp_part_common(), and timestamptz_part_common().
| int ParseDateTime | ( | const char * | timestr, |
| char * | workbuf, | ||
| size_t | buflen, | ||
| char ** | field, | ||
| int * | ftype, | ||
| int | maxfields, | ||
| int * | numfields | ||
| ) |
Definition at line 773 of file datetime.c.
References APPEND_CHAR, datebsearch(), datetktbl, DTERR_BAD_FORMAT, DTK_DATE, DTK_NUMBER, DTK_SPECIAL, DTK_STRING, DTK_TIME, DTK_TZ, fb(), pg_tolower(), and szdatetktbl.
Referenced by check_recovery_target_time(), date_in(), interval_in(), PGTYPESdate_from_asc(), PGTYPESinterval_from_asc(), PGTYPEStimestamp_from_asc(), time_in(), timestamp_in(), timestamptz_in(), and timetz_in().
Definition at line 690 of file datetime.c.
References Assert, DTERR_BAD_FORMAT, and fb().
Referenced by DecodeDateTime(), DecodeInterval(), DecodeTimeOnly(), and ParseFractionalSecond().
Definition at line 728 of file datetime.c.
References fb(), and ParseFraction().
Referenced by DecodeNumber(), DecodeNumberField(), and DecodeTimeCommon().
Definition at line 3882 of file datetime.c.
References Assert, DTERR_BAD_FORMAT, DTERR_FIELD_OVERFLOW, fb(), str, and val.
Referenced by DecodeISO8601Interval().
| Datum pg_timezone_abbrevs_abbrevs | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5211 of file datetime.c.
References TimeZoneAbbrevTable::abbrevs, BoolGetDatum(), CStringGetTextDatum, DateTimeParseError(), DetermineTimeZoneAbbrevOffsetTS(), DTERR_BAD_ZONE_ABBREV, DTZ, DYNTZ, elog, ERROR, fb(), FetchDynamicTimeZone(), get_call_result_type(), GetCurrentTransactionStartTimestamp(), heap_form_tuple(), HeapTupleGetDatum(), IntervalPGetDatum(), itmin2interval(), MemoryContextSwitchTo(), MemSet, now(), TimeZoneAbbrevTable::numabbrevs, palloc_object, pg_toupper(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, strlcpy(), datetkn::token, TOKMAXLEN, datetkn::type, TYPEFUNC_COMPOSITE, TZ, USECS_PER_SEC, datetkn::value, values, and zoneabbrevtbl.
| Datum pg_timezone_abbrevs_zone | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5124 of file datetime.c.
References tzEntry::abbrev, BoolGetDatum(), CStringGetTextDatum, elog, ERROR, fb(), get_call_result_type(), GetCurrentTransactionStartTimestamp(), heap_form_tuple(), HeapTupleGetDatum(), IntervalPGetDatum(), itmin2interval(), MemoryContextSwitchTo(), MemSet, now(), palloc_object, pg_get_next_timezone_abbrev(), pg_interpret_timezone_abbrev(), session_timezone, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, timestamptz_to_time_t(), TYPEFUNC_COMPOSITE, USECS_PER_SEC, and values.
| Datum pg_timezone_names | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5332 of file datetime.c.
References BoolGetDatum(), CStringGetTextDatum, fb(), GetCurrentTransactionStartTimestamp(), InitMaterializedSRF(), IntervalPGetDatum(), itmin2interval(), MemSet, palloc_object, pg_get_timezone_name(), pg_tzenumerate_end(), pg_tzenumerate_next(), pg_tzenumerate_start(), timestamp2tm(), tm, pg_tm::tm_isdst, tuplestore_putvalues(), USECS_PER_SEC, and values.
Definition at line 4962 of file datetime.c.
References FuncExpr::args, Assert, castNode, DatumGetInt32(), exprTypmod(), fb(), IsA, linitial, list_length(), lsecond, relabel_to_typmod(), and source.
Referenced by time_support(), and timestamp_support().
|
static |
Definition at line 1874 of file datetime.c.
References fb(), pg_timezone_abbrev_is_known(), pg_toupper(), strlcpy(), and TZ_STRLEN_MAX.
Referenced by DecodeTimezoneAbbrev(), and DecodeTimezoneAbbrevPrefix().
Definition at line 2561 of file datetime.c.
References date2j(), DAY, day_tab, DOY, DTERR_FIELD_OVERFLOW, DTERR_MD_FIELD_OVERFLOW, DTK_DATE_M, DTK_M, fb(), isleap, j2date(), MONTH, MONTHS_PER_YEAR, tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_yday, pg_tm::tm_year, and YEAR.
Referenced by DecodeDateTime(), DecodeTimeOnly(), do_to_timestamp(), make_date(), and make_timestamp_internal().
|
static |
Definition at line 105 of file datetime.c.
Referenced by CheckDateTokenTables(), DecodeSpecial(), and ParseDateTime().
Definition at line 75 of file datetime.c.
Referenced by PGTYPEStimestamp_add_interval(), timestamp_age(), timestamp_pl_interval(), timestamptz_age(), timestamptz_pl_interval_internal(), and ValidateDate().
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(), interval_cmp_value(), make_interval(), and PrintTiming().
|
static |
Definition at line 187 of file datetime.c.
Referenced by CheckDateTokenTables(), and DecodeUnits().
Definition at line 81 of file datetime.c.
Referenced by DCH_from_char(), DCH_to_char(), dttofmtasc_replace(), EncodeDateTime(), make_interval(), PGTYPESdate_defmt_asc(), and PGTYPESdate_fmt_asc().
Definition at line 181 of file datetime.c.
Referenced by CheckDateTokenTables(), DecodeSpecial(), and ParseDateTime().
|
static |
Definition at line 252 of file datetime.c.
Referenced by CheckDateTokenTables(), and DecodeUnits().
|
static |
Definition at line 272 of file datetime.c.
Referenced by ClearTimeZoneAbbrevCache(), DecodeTimezoneAbbrev(), and InstallTimeZoneAbbrevs().
|
static |
Definition at line 254 of file datetime.c.
Referenced by DecodeTimezoneAbbrev(), DecodeTimezoneAbbrevPrefix(), InstallTimeZoneAbbrevs(), and pg_timezone_abbrevs_abbrevs().