Parameter · Reporting and Logging / Process Title
update_process_title
Updates the process title to show the active SQL command. Enables updating of the process title every time a new SQL command is received by the server.
- Default:
on - Type: bool
- Applies: Session (superuser)
In plain words
Every PostgreSQL process changes its title, as seen in ps or top, to show what it is doing: idle, SELECT, idle in transaction, UPDATE waiting. That makes a quick look at the operating system very informative. Turning it off saves a tiny bit of work per statement.
For DBAs and operators
Each client backend title is postgres: [cluster_name: ] user database host activity, where activity is the command tag of the running statement, idle, idle in transaction, idle in transaction (aborted), and suffixes like waiting while blocked on a lock. Verified on 18.6: a backend started with update_process_title = off kept the title postgres: p5test: postgres postgres [local] startup while running a query.
Default on everywhere except Windows, where updating the title is expensive. The cost on Linux is small but measurable at very high statement rates (hundreds of thousands per second). Background processes always get their fixed title (checkpointer, walwriter …).
Combine with top -c or pidstat to map a CPU-hungry PID to a query class, then to pg_stat_activity for the full text:
SELECT pid, state, wait_event_type, wait_event, left(query, 80)
FROM pg_stat_activity WHERE pid = 5466;How to change it
A superuser (or a role granted SET) can change it per session with SET.