Go to the source code of this file.
Definition at line 78 of file timestamp.h.
Definition at line 76 of file timestamp.h.
Definition at line 73 of file timestamp.h.
Definition at line 81 of file timestamp.h.
Definition at line 79 of file timestamp.h.
Definition at line 82 of file timestamp.h.
Definition at line 77 of file timestamp.h.
Definition at line 80 of file timestamp.h.
Definition at line 65 of file timestamp.h.
Definition at line 63 of file timestamp.h.
Definition at line 64 of file timestamp.h.
Definition at line 69 of file timestamp.h.
Definition at line 67 of file timestamp.h.
Definition at line 68 of file timestamp.h.
Definition at line 72 of file timestamp.h.
Definition at line 143 of file timestamp.h.
Definition at line 85 of file timestamp.h.
Definition at line 86 of file timestamp.h.
Definition at line 125 of file timestamp.c.
References ereport, errcode(), errmsg(), ERROR, MAX_TIMESTAMP_PRECISION, and WARNING.
Referenced by anytimestamp_typmodin(), executeDateTimeMethod(), and transformSQLValueFunction().
Definition at line 5292 of file timestamp.c.
References date2j(), and j2day().
Referenced by DCH_to_char(), extract_date(), timestamp_part_common(), timestamp_trunc(), timestamptz_part_common(), and timestamptz_trunc_internal().
Definition at line 5347 of file timestamp.c.
References date2j(), and j2day().
Referenced by date2isoyearday(), DCH_to_char(), extract_date(), timestamp_part_common(), and timestamptz_part_common().
Definition at line 5404 of file timestamp.c.
References date2isoyear(), date2j(), and isoweek2j().
Referenced by DCH_to_char().
Definition at line 40 of file timestamp.h.
References DatumGetPointer().
Referenced by abs_interval(), check_timezone(), convert_timevalue_to_scalar(), gbt_intv_compress(), gbt_time_dist(), gbt_time_penalty(), gbt_ts_dist(), generate_series_timestamp_support(), in_range_interval_interval(), interval_dist(), time_dist(), timestamp_mi(), ts_dist(), and tstz_dist().
Definition at line 28 of file timestamp.h.
References DatumGetInt64().
Referenced by compareDatetime(), convert_timevalue_to_scalar(), cvt_timestamp_date(), cvt_timestamp_timestamptz(), executeDateTimeMethod(), gbt_num_compress(), generate_series_timestamp(), generate_series_timestamp_support(), in_range_timestamp_interval(), JsonEncodeDateTime(), map_sql_value_to_xml_value(), timestamp_decrement(), and timestamp_increment().
Definition at line 34 of file timestamp.h.
References DatumGetInt64().
Referenced by compareDatetime(), convert_timevalue_to_scalar(), cvt_timestamptz_date(), cvt_timestamptz_timestamp(), executeDateTimeMethod(), gbt_tstz_compress(), get_role_password(), JsonEncodeDateTime(), uuidv7_interval(), and validateRecoveryParameters().
Definition at line 1883 of file timestamp.c.
References USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by DecodeDateTime(), DecodeTimeOnly(), and timestamp2tm().
Definition at line 1645 of file timestamp.c.
References gettimeofday(), POSTGRES_EPOCH_JDATE, SECS_PER_DAY, UNIX_EPOCH_JDATE, and USECS_PER_SEC.
Referenced by ApplyLauncherMain(), asyncQueueFillWarning(), autoprewarm_main(), AutoVacLauncherMain(), BackendStartup(), BackgroundWriterMain(), bbsink_copystream_archive_contents(), bbsink_copystream_end_archive(), bbsink_copystream_new(), bbsink_throttle_begin_backup(), check_log_duration(), CheckPointGuts(), CleanupBackend(), clock_timestamp(), CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateOverwriteContrecordRecord(), CreateRestartPoint(), dblink_cancel_query(), DetermineSleepTime(), disable_timeout(), disable_timeouts(), do_analyze_rel(), do_start_worker(), enable_startup_progress_timeout(), enable_timeout_after(), enable_timeout_at(), enable_timeout_every(), enable_timeouts(), entry_alloc(), entry_reset(), get_candidate_xid(), get_role_password(), GetCurrentTransactionStopTimestamp(), GetReplicationApplyDelay(), handle_sig_alarm(), has_startup_progress_timeout_expired(), heap_vacuum_rel(), initialize_prng(), InitProcessGlobals(), InvalidatePossiblyObsoleteSlot(), KnownAssignedXidsCompress(), launcher_determine_sleep(), libpqsrv_cancel(), LockBufferForCleanup(), log_disconnections(), LogCheckpointEnd(), logicalrep_worker_launch(), LogicalRepApplyLoop(), maybe_start_bgworkers(), pa_send_data(), PerformAuthentication(), PerformWalRecovery(), pg_sleep(), pgfdw_abort_cleanup_begin(), pgfdw_cancel_query(), pgfdw_exec_cleanup_query(), pgfdw_finish_abort_cleanup(), pgfdw_get_cleanup_result(), pgss_shmem_startup(), pgstat_build_snapshot(), pgstat_report_activity(), pgstat_report_analyze(), pgstat_report_archiver(), pgstat_report_autovac(), pgstat_report_checksum_failures_in_db(), pgstat_report_stat(), pgstat_report_vacuum(), pgstat_reset(), pgstat_reset_after_failure(), pgstat_reset_counters(), pgstat_reset_of_kind(), pgstat_reset_slru(), PostgresMain(), PostgresSingleUserMain(), postmaster_child_launch(), PostmasterMain(), PrepareTransaction(), process_syncing_tables_for_apply(), ProcessConfigFileInternal(), ProcessPendingWrites(), ProcessRepliesIfAny(), ProcessStandbyPSRequestMessage(), ProcessStandbyReplyMessage(), ProcessWalSndrMessage(), ProcSleep(), rebuild_database_list(), RecordTransactionAbort(), RecordTransactionAbortPrepared(), RecordTransactionCommitPrepared(), recoveryApplyDelay(), ReplicationSlotRelease(), request_publisher_status(), reschedule_timeouts(), ResolveRecoveryConflictWithBufferPin(), ResolveRecoveryConflictWithLock(), ResolveRecoveryConflictWithVirtualXIDs(), RestoreSlotFromDisk(), send_feedback(), SetCurrentStatementStartTimestamp(), SetupApplyOrSyncWorker(), should_stop_conflict_info_retention(), StartBackgroundWorker(), StartTransaction(), test_pattern(), test_random(), test_random_operations(), throttle(), update_synced_slots_inactive_since(), UpdateWorkerStats(), wait_for_local_flush(), WaitExceedsMaxStandbyDelay(), WaitForWalSummarization(), WaitForWALToBecomeAvailable(), WalReceiverMain(), WalSndKeepalive(), WalSndLoop(), WalSndUpdateProgress(), WalSndWaitForWal(), WalSndWriteData(), XLogBackgroundFlush(), XLogFileRead(), XLogPrefetchResetStats(), XLogPrefetchShmemInit(), XLogRestorePoint(), XLogSendPhysical(), XLogWalRcvSendHSFeedback(), and XLogWalRcvSendReply().
Definition at line 2168 of file timestamp.c.
References elog, epoch, ERROR, pg_gmtime(), 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 date_in(), PGTYPESdate_from_asc(), and SetEpochTimestamp().
Definition at line 1663 of file timestamp.c.
References AdjustTimestampForTypmod(), and GetCurrentTransactionStartTimestamp().
Referenced by ExecEvalSQLValueFunction().
Definition at line 1677 of file timestamp.c.
References AdjustTimestampForTypmod(), GetCurrentTransactionStartTimestamp(), and timestamptz2timestamp().
Referenced by ExecEvalSQLValueFunction().
Definition at line 2047 of file timestamp.c.
References Interval::day, Interval::month, MONTHS_PER_YEAR, Interval::time, pg_itm::tm_hour, pg_itm::tm_mday, pg_itm::tm_min, pg_itm::tm_mon, pg_itm::tm_sec, pg_itm::tm_usec, pg_itm::tm_year, USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by interval_out(), interval_part_common(), interval_to_char(), and interval_trunc().
Definition at line 58 of file timestamp.h.
References PointerGetDatum().
Referenced by abs_interval(), gbt_intv_ssup_cmp(), gbt_intveq(), gbt_intvge(), gbt_intvgt(), gbt_intvkey_cmp(), gbt_intvle(), gbt_intvlt(), in_range_date_interval(), in_range_interval_interval(), in_range_timestamp_interval(), interval_avg(), leftmostvalue_interval(), pg_stat_get_wal_senders(), pg_timezone_abbrevs_abbrevs(), pg_timezone_abbrevs_zone(), timestamp_mi(), and uuidv7_interval().
Definition at line 5261 of file timestamp.c.
References isoweek2j(), and j2date().
Referenced by do_to_timestamp(), timestamp_trunc(), and timestamptz_trunc_internal().
Definition at line 5241 of file timestamp.c.
References date2j(), and j2day().
Referenced by date2isoyearday(), do_to_timestamp(), isoweek2date(), and isoweekdate2date().
Definition at line 5274 of file timestamp.c.
References isoweek2j(), and j2date().
Referenced by do_to_timestamp().
Definition at line 2077 of file timestamp.c.
References Interval::day, if(), INTERVAL_NOT_FINITE, Interval::month, MONTHS_PER_YEAR, pg_add_s64_overflow(), pg_mul_s64_overflow(), Interval::time, pg_itm::tm_hour, pg_itm::tm_mday, pg_itm::tm_min, pg_itm::tm_mon, pg_itm::tm_sec, pg_itm::tm_usec, pg_itm::tm_year, USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by interval_trunc(), timestamp_age(), and timestamptz_age().
Definition at line 2115 of file timestamp.c.
References Interval::day, if(), Interval::month, MONTHS_PER_YEAR, Interval::time, pg_itm_in::tm_mday, pg_itm_in::tm_mon, pg_itm_in::tm_usec, and pg_itm_in::tm_year.
Referenced by interval_in(), pg_timezone_abbrevs_abbrevs(), and pg_timezone_abbrevs_zone().
Definition at line 2190 of file timestamp.c.
References GetEpochTime(), tm, and tm2timestamp().
Referenced by dttofmtasc_replace(), PGTYPEStimestamp_from_asc(), timestamp_in(), timestamp_part_common(), timestamptz_in(), and timestamptz_part_common().
Definition at line 1820 of file timestamp.c.
References POSTGRES_EPOCH_JDATE, SECS_PER_DAY, tm, UNIX_EPOCH_JDATE, and USECS_PER_SEC.
Referenced by pg_control_checkpoint(), pg_control_system(), pg_ls_dir_files(), and pg_stat_file().
Definition at line 6445 of file timestamp.c.
References DetermineTimeZoneOffset(), dt2local(), ereport, errcode(), errmsg(), ERROR, IS_VALID_TIMESTAMP, session_timezone, timestamp2tm(), TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, TIMESTAMP_NOT_FINITE, and tm.
Referenced by cvt_timestamp_timestamptz(), timestamp2timestamptz(), and timestamp_cmp_timestamptz_internal().
Definition at line 1910 of file timestamp.c.
References dt2time(), INT64CONST, j2date(), pg_localtime(), POSTGRES_EPOCH_JDATE, SECS_PER_DAY, session_timezone, tm, pg_tm::tm_gmtoff, 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, pg_tm::tm_zone, TMODULO, UNIX_EPOCH_JDATE, USECS_PER_DAY, and USECS_PER_SEC.
Referenced by DetermineTimeZoneAbbrevOffsetTS(), executeDateTimeMethod(), GetCurrentTimeUsec(), JsonEncodeDateTime(), make_timestamptz_at_timezone(), map_sql_value_to_xml_value(), PGTYPEStimestamp_add_interval(), PGTYPEStimestamp_fmt_asc(), PGTYPEStimestamp_to_asc(), timestamp2date_opt_overflow(), timestamp2timestamptz_opt_overflow(), timestamp_age(), timestamp_out(), timestamp_part_common(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2date_opt_overflow(), timestamptz2timestamp_opt_overflow(), timestamptz_age(), timestamptz_out(), timestamptz_part_common(), timestamptz_pl_interval_internal(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_to_str(), timestamptz_trunc_internal(), timestamptz_zone(), and timetz_zone().
Definition at line 2210 of file timestamp.c.
Referenced by date_cmp_timestamp_internal(), generate_series_timestamp(), generate_series_timestamptz_internal(), timestamp_cmp(), timestamp_eq(), timestamp_ge(), timestamp_gt(), timestamp_larger(), timestamp_le(), timestamp_lt(), timestamp_ne(), and timestamp_smaller().
Definition at line 2363 of file timestamp.c.
References timestamp2timestamptz_opt_overflow(), TIMESTAMP_IS_NOBEGIN, TIMESTAMP_IS_NOEND, and timestamptz_cmp_internal.
Referenced by cmpTimestampToTimestampTz(), timestamp_cmp_timestamptz(), timestamp_eq_timestamptz(), timestamp_ge_timestamptz(), timestamp_gt_timestamptz(), timestamp_le_timestamptz(), timestamp_lt_timestamptz(), timestamp_ne_timestamptz(), timestamptz_cmp_timestamp(), timestamptz_eq_timestamp(), timestamptz_ge_timestamp(), timestamptz_gt_timestamp(), timestamptz_le_timestamp(), timestamptz_lt_timestamp(), and timestamptz_ne_timestamp().
Definition at line 1721 of file timestamp.c.
References start_time, and USECS_PER_SEC.
Referenced by check_log_duration(), has_startup_progress_timeout_expired(), heap_vacuum_rel(), InvalidatePossiblyObsoleteSlot(), launcher_determine_sleep(), log_disconnections(), LogRecoveryConflict(), pgstat_report_activity(), pgstat_update_dbstats(), ProcSleep(), schedule_alarm(), and TimestampDifferenceExceedsSeconds().
Definition at line 1781 of file timestamp.c.
References INT64CONST, and start_time.
Referenced by asyncQueueFillWarning(), AutoVacLauncherMain(), do_analyze_rel(), do_start_worker(), get_candidate_xid(), heap_vacuum_rel(), LockBufferForCleanup(), logicalrep_worker_launch(), maybe_start_bgworkers(), pa_send_data(), pgstat_report_stat(), process_syncing_tables_for_apply(), ProcSleep(), ResolveRecoveryConflictWithVirtualXIDs(), send_feedback(), should_stop_conflict_info_retention(), update_most_recent_deletion_info(), wait_for_local_flush(), WaitForWALToBecomeAvailable(), WalSndLoop(), WalSndUpdateProgress(), WalSndWaitForWal(), and XLogBackgroundFlush().
Definition at line 1795 of file timestamp.c.
References start_time, and TimestampDifference().
Referenced by DetermineSlotInvalidationCause().
Definition at line 90 of file timestamp.h.
References start_time.
Referenced by PostgresMain().
Definition at line 1757 of file timestamp.c.
References INT64CONST, pg_sub_s64_overflow(), and start_time.
Referenced by ApplyLauncherMain(), autoprewarm_main(), bbsink_copystream_archive_contents(), DetermineSleepTime(), do_analyze_rel(), GetReplicationApplyDelay(), GetReplicationTransferLatency(), libpqsrv_cancel(), LogCheckpointEnd(), pgfdw_get_cleanup_result(), pgstat_report_analyze(), pgstat_report_vacuum(), recoveryApplyDelay(), wait_for_local_flush(), WaitForWalSummarization(), WaitForWALToBecomeAvailable(), WalReceiverMain(), and WalSndComputeSleeptime().
Definition at line 46 of file timestamp.h.
References Int64GetDatum().
Referenced by cvt_date_timestamp(), cvt_timestamptz_timestamp(), date_mi_interval(), date_pl_interval(), ExecEvalSQLValueFunction(), executeDateTimeMethod(), gbt_num_fetch(), gbt_ts_dist(), gbt_ts_ssup_cmp(), gbt_tseq(), gbt_tsge(), gbt_tsgt(), gbt_tskey_cmp(), gbt_tsle(), gbt_tslt(), generate_series_timestamp(), generate_series_timestamp_support(), in_range_date_interval(), in_range_timestamp_interval(), leftmostvalue_timestamp(), parse_datetime(), timestamp_decrement(), timestamp_increment(), timestamp_mi_interval(), and timestamp_skipsupport().
Definition at line 6414 of file timestamp.c.
References pg_get_timezone_offset(), and session_timezone.
Referenced by ATColumnChangeRequiresRewrite().
Definition at line 6532 of file timestamp.c.
References ereport, errcode(), errmsg(), ERROR, timestamp2tm(), TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, TIMESTAMP_NOT_FINITE, tm, and tm2timestamp().
Referenced by cvt_timestamptz_timestamp(), and timestamptz2timestamp().
Definition at line 1862 of file timestamp.c.
References buf, EncodeDateTime(), EncodeSpecialTimestamp(), MAXDATELEN, snprintf, strlcpy(), timestamp2tm(), TIMESTAMP_NOT_FINITE, timestamptz_to_time_t(), tm, USE_ISO_DATES, and USECS_PER_SEC.
Referenced by CreateRestartPoint(), errdetail_apply_conflict(), getRecoveryStopReason(), InitWalRecovery(), PerformWalRecovery(), pg_decode_commit_prepared_txn(), pg_decode_commit_txn(), pg_decode_prepare_txn(), pg_decode_rollback_prepared_txn(), pg_decode_stream_commit(), pg_decode_stream_prepare(), ProcessStandbyHSFeedbackMessage(), ProcessStandbyReplyMessage(), ProcessWalSndrMessage(), recoveryStopsAfter(), recoveryStopsBefore(), xact_desc_abort(), xact_desc_commit(), xact_desc_prepare(), xlog_desc(), and xlogrecovery_redo().
Definition at line 1842 of file timestamp.c.
References POSTGRES_EPOCH_JDATE, SECS_PER_DAY, UNIX_EPOCH_JDATE, and USECS_PER_SEC.
Referenced by DetermineTimeZoneAbbrevOffsetTS(), InitProcessGlobals(), pg_timezone_abbrevs_zone(), and timestamptz_to_str().
Definition at line 52 of file timestamp.h.
References Int64GetDatum().
Referenced by cvt_date_timestamptz(), cvt_timestamp_timestamptz(), ExecEvalSQLValueFunction(), executeDateTimeMethod(), generate_series_timestamptz_internal(), parse_datetime(), pg_control_checkpoint(), pg_control_system(), pg_cursor(), pg_get_replication_slots(), pg_last_committed_xact(), pg_lock_status(), pg_ls_dir_files(), pg_prepared_statement(), pg_prepared_xact(), pg_stat_file(), pg_stat_get_activity(), pg_stat_get_archiver(), pg_stat_get_recovery_prefetch(), pg_stat_get_replication_slot(), pg_stat_get_slru(), pg_stat_get_subscription(), pg_stat_get_subscription_stats(), pg_stat_get_wal_receiver(), pg_stat_get_wal_senders(), pg_stat_io_build_tuples(), pg_stat_statements_info(), pg_stat_statements_internal(), pg_stat_wal_build_tuple(), pg_xact_commit_timestamp_origin(), and uuidv7_interval().
Definition at line 2006 of file timestamp.c.
References date2j(), dt2local(), IS_VALID_JULIAN, IS_VALID_TIMESTAMP, pg_add_s64_overflow(), pg_mul_s64_overflow(), POSTGRES_EPOCH_JDATE, 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.
Referenced by check_recovery_target_time(), parse_datetime(), PGTYPEStimestamp_add_interval(), PGTYPEStimestamp_current(), PGTYPEStimestamp_defmt_scan(), PGTYPEStimestamp_from_asc(), SetEpochTimestamp(), timestamp_in(), timestamp_pl_interval(), timestamp_trunc(), timestamp_zone(), timestamptz2timestamp_opt_overflow(), timestamptz_in(), timestamptz_pl_interval_internal(), timestamptz_trunc_internal(), timestamptz_zone(), and to_timestamp().
Definition at line 57 of file timestamp.c.
Referenced by pg_conf_load_time(), and ProcessConfigFileInternal().
Definition at line 54 of file timestamp.c.
Referenced by pg_postmaster_start_time(), PostgresSingleUserMain(), and PostmasterMain().