Configuration parameter

application_name — PostgreSQL configuration parameter

Category Error Reporting and Logging

The application_name can be any string of less than NAMEDATALEN characters (64 characters in a standard build).

At a glance

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

What it does

The application_name can be any string of less than NAMEDATALEN characters (64 characters in a standard build). It is typically set by an application upon connection to the server. The name will be displayed in the pg_stat_activity view and included in CSV log entries. It can also be included in regular log entries via the log_line_prefix parameter. Only printable ASCII characters may be used in the application_name value. Other characters are replaced with C-style hexadecimal escapes.

(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 application_name; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'application_name';.

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 — application_name.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters