Assuming it is unix.... The command
ps xau|grep post
If it is running it will produce output like...
[EMAIL PROTECTED]:~$ ps xau|grep post
postgres 880 0.0 0.2 8580 740 ? S Sep07 0:31 /usr/lib/postgresql/bin/postmaster
postgres 887 0.0 0.2 9536 612 ? S Sep07 0:02 postgres: stats buffer process
postgres 889 0.0 0.2 8624 632 ? S Sep07 0:05 postgres: stats collector process
worik 25927 0.0 0.2 1612 540 pts/10 S 13:54 0:00 grep post
[EMAIL PROTECTED]:~$
If it is not running it will produce output like...
[EMAIL PROTECTED]:~$ ps xau|grep post worik 26094 0.0 0.2 1608 528 pts/10 S 13:55 0:00 grep post
Sandeep Gaikwad wrote:
Hello Sir,
I want to know how to check whether postgres database is running or not ? when I give command like ./postmaster -i &, whether all databases in that postgres will run or any one [default] ? If any one, then how to detect that database ?
Thanks and regards, Sandeep.
------------------------------------------------------------------------
---------------------------------------------------------
Disclaimer:
The contents of this message are confidential and intended to the addressee at the specified e-mail address only. Its contents may not be copied or disclosed to anyone other than the intended recipient. If this e-mail is received in error, please contact Vertex Software Pvt. Ltd immediately on +91 20 4041500 with details of the sender and addressee and delete the e-mail. Vertex Software Pvt. Ltd accepts no responsibility in the event that the onward transmission, opening or use of this message and/or any attachments adversely affects the recipient's systems or data. It is the recipient's responsibility to carry out such virus and other checks as the recipient considers appropriate.
---------------------------------------------------------
------------------------------------------------------------------------
---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings
---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html