|
PostgreSQL Source Code git master
|


Go to the source code of this file.
Variables | |
| PGDLLIMPORT TimestampTz | PgStartTime |
| PGDLLIMPORT TimestampTz | PgReloadTime |
| #define INTERVAL_FULL_PRECISION (0xFFFF) |
Definition at line 78 of file timestamp.h.
| #define INTERVAL_FULL_RANGE (0x7FFF) |
Definition at line 76 of file timestamp.h.
Definition at line 73 of file timestamp.h.
| #define INTERVAL_PRECISION | ( | t | ) | ((t) & INTERVAL_PRECISION_MASK) |
Definition at line 81 of file timestamp.h.
| #define INTERVAL_PRECISION_MASK (0xFFFF) |
Definition at line 79 of file timestamp.h.
| #define INTERVAL_RANGE | ( | t | ) | (((t) >> 16) & INTERVAL_RANGE_MASK) |
Definition at line 82 of file timestamp.h.
| #define INTERVAL_RANGE_MASK (0x7FFF) |
Definition at line 77 of file timestamp.h.
| #define INTERVAL_TYPMOD | ( | p, | |
| r | |||
| ) | ((((r) & INTERVAL_RANGE_MASK) << 16) | ((p) & INTERVAL_PRECISION_MASK)) |
Definition at line 80 of file timestamp.h.
| #define PG_GETARG_INTERVAL_P | ( | n | ) | DatumGetIntervalP(PG_GETARG_DATUM(n)) |
Definition at line 65 of file timestamp.h.
| #define PG_GETARG_TIMESTAMP | ( | n | ) | DatumGetTimestamp(PG_GETARG_DATUM(n)) |
Definition at line 63 of file timestamp.h.
| #define PG_GETARG_TIMESTAMPTZ | ( | n | ) | DatumGetTimestampTz(PG_GETARG_DATUM(n)) |
Definition at line 64 of file timestamp.h.
| #define PG_RETURN_INTERVAL_P | ( | x | ) | return IntervalPGetDatum(x) |
Definition at line 69 of file timestamp.h.
| #define PG_RETURN_TIMESTAMP | ( | x | ) | return TimestampGetDatum(x) |
Definition at line 67 of file timestamp.h.
| #define PG_RETURN_TIMESTAMPTZ | ( | x | ) | return TimestampTzGetDatum(x) |
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 116 of file timestamp.c.
References ereport, errcode(), errmsg, ERROR, fb(), MAX_TIMESTAMP_PRECISION, and WARNING.
Referenced by anytimestamp_typmodin(), executeDateTimeMethod(), and transformSQLValueFunction().
Definition at line 5286 of file timestamp.c.
References date2j(), fb(), and j2day().
Referenced by DCH_to_char(), extract_date(), timestamp_part_common(), timestamp_trunc(), timestamptz_part_common(), and timestamptz_trunc_internal().
Definition at line 5341 of file timestamp.c.
References date2j(), fb(), and j2day().
Referenced by date2isoyearday(), DCH_to_char(), extract_date(), timestamp_part_common(), and timestamptz_part_common().
Definition at line 5398 of file timestamp.c.
References date2isoyear(), date2j(), fb(), and isoweek2j().
Referenced by DCH_to_char().
Definition at line 40 of file timestamp.h.
References DatumGetPointer(), and fb().
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(), and fb().
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().
|
inlinestatic |
Definition at line 34 of file timestamp.h.
References DatumGetInt64(), and fb().
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 1874 of file timestamp.c.
References fb(), USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by DecodeDateTime(), DecodeTimeOnly(), timestamp2tm(), and timestamp2tm().
|
extern |
Definition at line 1636 of file timestamp.c.
References fb(), 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(), launch_sync_worker(), 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_replslotsync(), 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(), 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(), WaitForLSN(), WaitForWalSummarization(), WaitForWALToBecomeAvailable(), WalReceiverMain(), WalSndKeepalive(), WalSndLoop(), WalSndUpdateProgress(), WalSndWaitForWal(), WalSndWriteData(), XLogBackgroundFlush(), XLogFileRead(), XLogPrefetchResetStats(), XLogPrefetchShmemInit(), XLogRestorePoint(), XLogSendPhysical(), XLogWalRcvSendHSFeedback(), and XLogWalRcvSendReply().
Definition at line 2159 of file timestamp.c.
References elog, epoch, ERROR, fb(), 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(), SetEpochTimestamp(), and SetEpochTimestamp().
|
extern |
Definition at line 1654 of file timestamp.c.
References AdjustTimestampForTypmod(), fb(), and GetCurrentTransactionStartTimestamp().
Referenced by ExecEvalSQLValueFunction().
Definition at line 1668 of file timestamp.c.
References AdjustTimestampForTypmod(), fb(), GetCurrentTransactionStartTimestamp(), and timestamptz2timestamp().
Referenced by ExecEvalSQLValueFunction().
Definition at line 2038 of file timestamp.c.
References fb(), MONTHS_PER_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 fb(), and 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(), pg_timezone_names(), timestamp_mi(), and uuidv7_interval().
Definition at line 5255 of file timestamp.c.
References fb(), isoweek2j(), and j2date().
Referenced by do_to_timestamp(), timestamp_trunc(), and timestamptz_trunc_internal().
Definition at line 5235 of file timestamp.c.
References date2j(), fb(), and j2day().
Referenced by date2isoyearday(), do_to_timestamp(), isoweek2date(), and isoweekdate2date().
Definition at line 5268 of file timestamp.c.
References fb(), isoweek2j(), and j2date().
Referenced by do_to_timestamp().
Definition at line 2068 of file timestamp.c.
References fb(), INTERVAL_NOT_FINITE, MONTHS_PER_YEAR, pg_add_s64_overflow(), pg_mul_s64_overflow(), USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by interval_trunc(), timestamp_age(), and timestamptz_age().
Definition at line 2106 of file timestamp.c.
References fb(), and MONTHS_PER_YEAR.
Referenced by interval_in(), pg_timezone_abbrevs_abbrevs(), pg_timezone_abbrevs_zone(), and pg_timezone_names().
Definition at line 2181 of file timestamp.c.
References fb(), GetEpochTime(), tm, and tm2timestamp().
|
extern |
Definition at line 1811 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().
|
extern |
Definition at line 6439 of file timestamp.c.
References DetermineTimeZoneOffset(), dt2local(), ereturn, errcode(), errmsg, fb(), 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().
|
extern |
Definition at line 1901 of file timestamp.c.
References dt2time(), fb(), 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(), map_sql_value_to_xml_value(), pg_timezone_names(), timestamp2date_safe(), timestamp_time(), timestamp_to_char(), timestamptz2date_safe(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), and timetz_zone().
Definition at line 2201 of file timestamp.c.
References fb().
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().
|
extern |
Definition at line 2354 of file timestamp.c.
References ErrorSaveContext::error_occurred, fb(), timestamp2timestamptz_safe(), 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().
|
extern |
Definition at line 1712 of file timestamp.c.
References fb(), 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().
|
extern |
Definition at line 1772 of file timestamp.c.
References fb(), INT64CONST, and start_time.
Referenced by asyncQueueFillWarning(), AutoVacLauncherMain(), do_analyze_rel(), do_start_worker(), get_candidate_xid(), heap_vacuum_rel(), launch_sync_worker(), LockBufferForCleanup(), logicalrep_worker_launch(), maybe_start_bgworkers(), pa_send_data(), pgstat_report_stat(), ProcSleep(), ResolveRecoveryConflictWithVirtualXIDs(), send_feedback(), should_stop_conflict_info_retention(), update_most_recent_deletion_info(), wait_for_local_flush(), WaitForWALToBecomeAvailable(), WalSndLoop(), WalSndUpdateProgress(), WalSndWaitForWal(), and XLogBackgroundFlush().
|
extern |
Definition at line 1786 of file timestamp.c.
References fb(), start_time, and TimestampDifference().
Referenced by DetermineSlotInvalidationCause().
|
inlinestatic |
Definition at line 90 of file timestamp.h.
References fb(), and start_time.
Referenced by get_role_password(), and PostgresMain().
|
extern |
Definition at line 1748 of file timestamp.c.
References fb(), 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(), WaitForLSN(), WaitForWalSummarization(), WaitForWALToBecomeAvailable(), WalReceiverMain(), and WalSndComputeSleeptime().
Definition at line 46 of file timestamp.h.
References fb(), and 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 6408 of file timestamp.c.
References pg_get_timezone_offset(), and session_timezone.
Referenced by ATColumnChangeRequiresRewrite().
|
extern |
Definition at line 6511 of file timestamp.c.
References ereturn, errcode(), errmsg, fb(), timestamp2tm(), TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, TIMESTAMP_NOT_FINITE, tm, and tm2timestamp().
Referenced by cvt_timestamptz_timestamp(), and timestamptz2timestamp().
|
extern |
Definition at line 1853 of file timestamp.c.
References buf, EncodeDateTime(), EncodeSpecialTimestamp(), fb(), 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().
|
extern |
Definition at line 1833 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().
|
inlinestatic |
Definition at line 52 of file timestamp.h.
References fb(), and 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(), 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(), test_custom_stats_fixed_report(), and uuidv7_interval().
Definition at line 1997 of file timestamp.c.
References date2j(), dt2local(), fb(), 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_defmt_scan(), and to_timestamp().
|
extern |
Definition at line 48 of file timestamp.c.
Referenced by pg_conf_load_time(), and ProcessConfigFileInternal().
|
extern |
Definition at line 45 of file timestamp.c.
Referenced by pg_postmaster_start_time(), PostgresSingleUserMain(), and PostmasterMain().