4848
4949<screen>
5050$ ps auxww | grep ^postgres
51- postgres 960 0.0 1.1 6104 1480 pts/1 SN 13:17 0:00 postgres -i
52- postgres 963 0.0 1.1 7084 1472 pts/1 SN 13:17 0:00 postgres: writer process
53- postgres 965 0.0 1.1 6152 1512 pts/1 SN 13:17 0:00 postgres: stats collector process
54- postgres 998 0.0 2.3 6532 2992 pts/1 SN 13:18 0:00 postgres: tgl runbug 127.0.0.1 idle
55- postgres 1003 0.0 2.4 6532 3128 pts/1 SN 13:19 0:00 postgres: tgl regression [local] SELECT waiting
56- postgres 1016 0.1 2.4 6532 3080 pts/1 SN 13:19 0:00 postgres: tgl regression [local] idle in transaction
51+ postgres 15551 0.0 0.1 57536 7132 pts/0 S 18:02 0:00 postgres -i
52+ postgres 15554 0.0 0.0 57536 1184 ? Ss 18:02 0:00 postgres: writer process
53+ postgres 15555 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres: checkpointer process
54+ postgres 15556 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres: wal writer process
55+ postgres 15557 0.0 0.0 58504 2244 ? Ss 18:02 0:00 postgres: autovacuum launcher process
56+ postgres 15558 0.0 0.0 17512 1068 ? Ss 18:02 0:00 postgres: stats collector process
57+ postgres 15582 0.0 0.0 58772 3080 ? Ss 18:04 0:00 postgres: joe runbug 127.0.0.1 idle
58+ postgres 15606 0.0 0.0 58772 3052 ? Ss 18:07 0:00 postgres: tgl regression [local] SELECT waiting
59+ postgres 15610 0.0 0.0 58772 3056 ? Ss 18:07 0:00 postgres: tgl regression [local] idle in transaction
5760</screen>
5861
5962 (The appropriate invocation of <command>ps</> varies across different
6063 platforms, as do the details of what is shown. This example is from a
6164 recent Linux system.) The first process listed here is the
6265 master server process. The command arguments
63- shown for it are the same ones used when it was launched. The next two
66+ shown for it are the same ones used when it was launched. The next five
6467 processes are background worker processes automatically launched by the
6568 master process. (The <quote>stats collector</> process will not be present
66- if you have set
67- the system not to start the statistics collector.) Each of the remaining
69+ if you have set the system not to start the statistics collector; likewise
70+ the <quote>autovacuum launcher</> process can be disabled.)
71+ Each of the remaining
6872 processes is a server process handling one client connection. Each such
6973 process sets its command line display in the form
7074
@@ -79,8 +83,12 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
7983 or a command type name such as <literal>SELECT</>. Also,
8084 <literal>waiting</> is appended if the server process is presently waiting
8185 on a lock held by another session. In the above example we can infer
82- that process 1003 is waiting for process 1016 to complete its transaction and
83- thereby release some lock.
86+ that process 15606 is waiting for process 15610 to complete its transaction
87+ and thereby release some lock. (Process 15610 must be the blocker, because
88+ there is no other active session. In more complicated cases it would be
89+ necessary to look into the
90+ <link linkend="view-pg-locks"><structname>pg_locks</structname></link>
91+ system view to determine who is blocking whom.)
8492 </para>
8593
8694 <para>
0 commit comments