Configuration parameter

log_error_verbosity — PostgreSQL configuration parameter

Category Error Reporting and Logging

Controls the amount of detail written in the server log for each message that is logged.

At a glance

Property Value
Parameter log_error_verbosity
Category Error Reporting and Logging
Default (see documentation)
Value type enum
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

Controls the amount of detail written in the server log for each message that is logged. Valid values are TERSE, DEFAULT, and VERBOSE, each adding more fields to displayed messages. TERSE excludes the logging of DETAIL, HINT, QUERY, and CONTEXT error information. VERBOSE output includes the SQLSTATE error code (see also errcodes_appendix) and the source code file name, function name, and line number that generated the error. Only superusers and users with the appropriate SET privilege can change this setting.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW log_error_verbosity; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'log_error_verbosity';.

Tuning guidance

Tune this for observability versus log volume, not for raw performance. More verbose logging helps diagnose problems but costs disk and I/O; quieter logging saves space but hides detail. Pick a level your log pipeline can store and search, and raise verbosity temporarily when investigating an incident.

Reference

PostgreSQL documentation — log_error_verbosity.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters