В документацията на PostgreSQL се казва, че използва /usr/ucb/ps с опции -ww за получаване на имена на процеси вместо обикновени /usr/bin/ps, но по-голямата част от информацията е скрита и от опцията /usr/ucb/ps. Нека видим как да извлечем пълни имена на процеси на postgres в solaris.
По-долу са моите процеси на екземпляр от postgres 9.1 на Solaris:
bash-3.00$ /usr/ucb/ps -awwx | grep postgres
7778 ? S 0:04 /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
7779 ? S 0:01 /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
7780 ? S 0:00 /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
7781 ? S 0:00 /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
7776 pts/5 S 0:00 /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
По-разширен начин с pargs:
bash-3.00$ pargs `/usr/ucb/ps -awwx | grep postgres | awk '{print $1}'`
7778: /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
argv[0]: postgres: writer process
argv[1]:
argv[2]:
7779: /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
argv[0]: postgres: wal writer process
argv[1]:
argv[2]:
7780: /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
argv[0]: postgres: autovacuum launcher process
argv[1]:
argv[2]:
7781: /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
argv[0]: postgres: stats collector process
argv[1]:
argv[2]:
7776: /Desktop/postgres/9.1-pgdg/bin/64/postgres -D /Desktop/postgres/9.1-pgdg/data
argv[0]: /Desktop/postgres/9.1-pgdg/bin/64/postgres
argv[1]: -D
argv[2]: /Desktop/postgres/9.1-pgdg/data
7776 е postmaster демон процес.
bash-3.00$ cat /Desktop/postgres/9.1-pgdg/data/postmaster.pid
7776
/Desktop/postgres/9.1-pgdg/data
1339917119
5432
/tmp
localhost
5432001 50331683
Въпреки че изглежда просто, вярвам, че си струва да се знае :).