Skip to content

log_timezone

log_timezone is the PostgreSQL setting that defines the time zone to use in log messages.
Note

Fact — official short description: “Sets the time zone to use in log messages.”

Identity

Type , Valuestring
Upstream pg_settings type
Context , Valuesighup
Takes effect after configuration reload
Unit , Value
Raw unit
Range , Value
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueReporting and Logging / What to Log
Upstream classification
Latest boot value , ValueGMT
GMT

Lifecycle

Fact Value
First observed PG9.0 (research boundary)
Present in PG9.0–19 Beta 3
Removed in No
Introduction commit Not asserted: predates the PG9.0 research boundary
Commit date
Discussion

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG9.0 UNKNOWN UNKNOWN
PG9.1 not set
PG9.2–19 Beta 3 GMT GMT

How it works

log_timezone sets the time zone to use in log messages. It affects timestamps rendered by the logging system, including filename expansion context, but does not change session TimeZone or stored timestamps.

log_timezone is a SIGHUP-context setting: a configuration reload activates the new server value without a restart; subsequent operations that consult it use the refreshed value.

It changes emitted diagnostic data rather than query semantics, but volume, sensitive content, log_line_prefix, destinations, collector throughput, and retention determine operational cost and usefulness.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Use one cluster-wide timezone, normally UTC, so every session’s server-log timestamps correlate across hosts, replicas, failovers, and centralized ingestion. Test parsers and log_filename expansion before changing it.
OLAP Analytical workload type does not justify a separate log timezone. Keep UTC or the fleet standard and convert to local civil time only in reporting tools, especially across DST transitions.
Small nodes Keep UTC unless an existing operational pipeline requires another stable zone. Changing log_timezone does not reduce log volume; it changes timestamp interpretation and potentially rotated filenames.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP UTC different 'UTC'
OLAP UTC different 'UTC'
CRIT UTC different 'UTC'
TINY UTC different 'UTC'
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 = UTC (dcs); OLAP: PG9.0–19 Beta 3 = UTC (dcs); CRIT: PG9.0–19 Beta 3 = UTC (dcs); TINY: PG9.0–19 Beta 3 = UTC (dcs). Advice, pending human review — Editorial inference: UTC makes timestamps comparable across hosts, regions, failovers, and centralized log systems.

Common pitfalls

  • Editing log_timezone without reloading configuration and verifying the effective value and subsequent behavior.
  • Enabling richer logging without budgeting collector throughput, storage, retention, and downstream query cost.
  • Writing SQL text, bind values, identities, or host data without a redaction and access-control policy.
  • Changing log_timezone globally without a rollback plan and a client or operational compatibility test.

DateStyle · IntervalStyle · TimeZone · lc_time · timezone_abbreviations

References