DB Internals AtlasPostgreSQL 18.6 Home About

Parameters

Reporting and Logging

44 PostgreSQL 18.6 parameters. Each one has its own animation and explanation.

Process Title

  • cluster_name: A name shown in every process title (ps) to tell clusters apart on the same host.
  • update_process_title: Update each backend's ps title with what it is doing (idle, SELECT, waiting…).

What to Log

  • application_name: A label the client sets (e.g. "billing-api"), shown in pg_stat_activity and %a in logs.
  • debug_pretty_print: Indent the trees printed by debug_print_parse/rewritten/plan so humans can read them.
  • debug_print_parse: Dump each query's raw parse tree (internal node format) into the log. Debugging only.
  • debug_print_plan: Dump each query's full internal execution plan tree into the log. Debugging only.
  • debug_print_rewritten: Dump each query's tree after the rewriter (views and rules expanded). Debugging only.
  • log_autovacuum_min_duration: Log autovacuum/autoanalyze runs that take at least this long (default 10min; 0 logs all).
  • log_checkpoints: Log each checkpoint: why it started and how long writing and syncing took (default on).
  • log_connections: Which steps of connection setup to log: receipt, authentication, authorization, setup_durations.
  • log_disconnections: Log the end of each session with its total duration, user, database and client.
  • log_duration: Log the duration of every completed statement (without its text unless logged elsewhere).
  • log_error_verbosity: How much detail per logged message: terse, default, or verbose (adds SQLSTATE and source).
  • log_hostname: Resolve client IPs to host names in connection logs (costs a DNS lookup per connection).
  • log_line_prefix: printf-style prefix for each stderr log line: %m time, %p pid, %u user, %d db, %a app …
  • log_lock_failures: New in PG18: log who held the lock when a SELECT … NOWAIT row lock fails.
  • log_lock_waits: Log when a session has waited longer than deadlock_timeout for a lock, and who holds it.
  • log_parameter_max_length: Cap (bytes) for bind-parameter values printed with logged statements (-1 = full, 0 = none).
  • log_parameter_max_length_on_error: Bytes of each bind parameter to show in error reports (0 = none, the default; -1 = full).
  • log_recovery_conflict_waits: On a standby, log when WAL replay waits longer than deadlock_timeout on a conflicting query.
  • log_replication_commands: Log each replication-protocol command (IDENTIFY_SYSTEM, START_REPLICATION, …).
  • log_statement: Log statements by type: none, ddl (CREATE/ALTER/DROP), mod (+ data changes), or all.
  • log_temp_files: Log temporary files (sort/hash spills) at least this big when deleted (-1 off, 0 all).
  • log_timezone: Time zone used for timestamps in the server log (%m, %t) and in log file names.

When to Log

Where to Log

  • event_source: Windows only: the source name PostgreSQL uses when writing to the Windows Event Log.
  • log_destination: Where log messages go: stderr, csvlog, jsonlog, syslog or eventlog (comma list).
  • log_directory: Folder for log files written by the logging collector (relative to the data directory).
  • log_file_mode: Unix permissions for new log files (default 0600: only the postgres user can read them).
  • log_filename: File name pattern for log files; strftime escapes like %Y-%m-%d or %a decide rotation names.
  • log_rotation_age: Start a new log file after this much time (default 1 day; 0 disables time-based rotation).
  • log_rotation_size: Start a new log file once the current one reaches this size (default 10MB; 0 disables).
  • log_truncate_on_rotation: On a time-based rotation, overwrite (not append to) an existing file with the same name.
  • logging_collector: Start the "logger" process that captures stderr/CSV/JSON output into rotated files.
  • syslog_facility: Syslog "facility" (LOCAL0 … LOCAL7) used when log_destination includes syslog.
  • syslog_ident: Program name PostgreSQL uses in syslog lines (default "postgres").
  • syslog_sequence_numbers: Prefix syslog messages with [N] counters so the daemon does not collapse repeats.
  • syslog_split_messages: Split long or multi-line messages into separate syslog lines of at most ~900 bytes.