On Linux:
- ps-ef |greppostgres | grep-v grep
- shows all postgres processes
- works on all Linux distros
- second grep pipe just filters out line with “grep postgres” command
- you will see something like this – of course directories can be different:postgres 2406 1 0 Apr14 ? 00:00:33 /var/postgresql/9.3/bin/postgres -D /mypgdir/pgdata -p 5432 -i
postgres 2407 2406 0 Apr14 ? 00:00:00 postgres: logger process
postgres 2409 2406 0 Apr14 ? 00:00:03 postgres: checkpointer process
postgres 2410 2406 0 Apr14 ? 00:00:00 postgres: writer process
postgres 2411 2406 0 Apr14 ? 00:00:00 postgres: wal writer process
postgres 2412 2406 0 Apr14 ? 00:00:34 postgres: autovacuum launcher process
postgres 2413 2406 0 Apr14 ? 00:00:48 postgres: stats collector process
postgres 2586 2406 0 Apr14 ? 00:00:00 postgres: mytestuser mytestdatabase 127.0.0.1(60492) idle
On PcBSD:
- to see processes in simple form “close enough to Linux form” use this command:
ps -A | grep postgres | grep -v grep - you will see something like this:
82267 – Is 0:00.01 postgres: checkpointer process (postgres)
82268 – Ss 0:00.04 postgres: writer process (postgres)
82269 – Ss 0:00.01 postgres: wal writer process (postgres)
82270 – Ss 0:00.01 postgres: autovacuum launcher process (postgres)
82271 – Ss 0:00.03 postgres: stats collector process (postgres)
82265 1 S 0:00.04 /usr/local/bin/postgres -D /usr/local/pgsql/data
On Windows:
Because different versions and different distributions of Windows can show different things you have to try what you will see on your Windows.
- Workstation with Windows 8.1 Pro
- start standard “Task Manager” (right-click on taskbar / option “task manager” somewhere in the middle):
- go to tab “Details”
- if you see only a few columns make right-click on some column name and choose “Select columns”
- add at least “Command line” – you will see here all parameters of the process
- other useful columns for checking the problems are “CPU time”, “I/O read bytes”, “I/O write bytes” (you will get the description of every column when you hover with mouse cursor over column name )
- interesting are also:
- “Operating system context” – shows in which Windows version are processes really running – for example on my Win 8.1 workstation I see all postgres processes running in “Windows Vista” context
- Platform – 32 bit / 64 bit
- you will see something like this:
- this is just a sample which does not show all postgres processes
- as you can see I have multiple versions of PG server running – which is no problem on Windows