Re: [SQL] How to check postgres running or not ?

2004-09-20 Thread Reiner Dassing
Hello! Our check procedure on TRU64 UNIX is: checkmasterdaemon if [ $? -eq 1 ]; then # Try to connect to postgres by selecting tables TABELLEN=`/pg/postgresql-7.4.3/bin/psql -h postgres -c 'select datname from pg_database' postgres postgres 2/dev/null` if [[

Re: [SQL] How to check postgres running or not ?

2004-09-20 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Worik wrote: | | | [snip] | | | | Just to enforce the test is better looking for the entire executable | path: | | ps aux | grep /usr/bin/postmaster | grep -v grep | | | Does not work for me! | | [EMAIL PROTECTED]:~$ ps aux | grep

Re: [SQL] How to check postgres running or not ?

2004-09-20 Thread Peter Eisentraut
Am Montag, 20. September 2004 12:05 schrieb Gaetano Mendola: It only depends on your distribution, in your case: ps aux | grep /usr/lib/postgresql/bin/postmaster | grep -v grep consider also the if you run different postmaster version in different location this is the only way I believe Or

Re: [SQL] How to check postgres running or not ?

2004-09-20 Thread Theodore Petrosky
Funny... I set up a little program on my development machine that queries for the rendezvous name. This way I know my development machine is running before I try to connect. I think zeroconf could be used for this quite easily... JMHO Ted --- Arne Stoelck [EMAIL PROTECTED] wrote: How

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Geoffrey
Worik wrote: Assuming it is unix The command ps xau|grep post You might want to change that to: ps aux|grep postgres As your suggestion will pick up extraneous data if one is running postfix on the same box. -- Until later, Geoffrey Registered Linux User #108567

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Tom Lane
Geoffrey [EMAIL PROTECTED] writes: Worik wrote: Assuming it is unix The command ps xau|grep post You might want to change that to: ps aux|grep postgres As your suggestion will pick up extraneous data if one is running postfix on the same box. Actually I'd recommend grepping for

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Andrew Sullivan
On Sun, Sep 19, 2004 at 12:25:00PM -0400, Tom Lane wrote: ps aux | grep postmaster | grep -v grep (or use ps -ef if using a SysV-ish ps). Except that on Solaris, ps -ef _always_ shows postmaster, even for the individual back ends. A -- Andrew Sullivan | [EMAIL PROTECTED] In the future

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Tom Lane
Andrew Sullivan [EMAIL PROTECTED] writes: On Sun, Sep 19, 2004 at 12:25:00PM -0400, Tom Lane wrote: ps aux | grep postmaster | grep -v grep (or use ps -ef if using a SysV-ish ps). Except that on Solaris, ps -ef _always_ shows postmaster, even for the individual back ends. Right, but if you

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Gaetano Mendola
Jeff Eckermann wrote: --- Christopher Browne [EMAIL PROTECTED] wrote: In an attempt to throw the authorities off his trail, [EMAIL PROTECTED] (Sandeep Gaikwad) transmitted: Hello Sir, I want to know how to check whether postgres database is running or not ? when I give command

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Gaetano Mendola
Tom Lane wrote: Geoffrey [EMAIL PROTECTED] writes: Worik wrote: Assuming it is unix The command ps xau|grep post You might want to change that to: ps aux|grep postgres As your suggestion will pick up extraneous data if one is running postfix on the same box. Actually I'd recommend grepping

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Andrew Sullivan
On Sun, Sep 19, 2004 at 01:12:07PM -0400, Tom Lane wrote: Except that on Solaris, ps -ef _always_ shows postmaster, even for the individual back ends. Right, but if you see a backend then you can figure the system is up. Oops, good point. (And in any case, on Solaris you also have the ucb

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Worik
[snip] Just to enforce the test is better looking for the entire executable path: ps aux | grep /usr/bin/postmaster | grep -v grep Does not work for me! [EMAIL PROTECTED]:~$ ps aux | grep /usr/bin/postmaster | grep -v grep [EMAIL PROTECTED]:~$ ps aux | grep postmaster | grep -v grep

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Worik
Perhaps I have a bug in pg_ctrl? This is what I get... [EMAIL PROTECTED]:~$ ps aux | grep postmaster | grep -v grep ;/usr/lib/postgresql/bin/pg_ctl status postgres 670 0.0 0.6 8544 1688 pts/1S12:33 0:00 /usr/lib/postgresql/bin/postmaster pg_ctl: postmaster or postgres is not

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Tom Lane
Worik [EMAIL PROTECTED] writes: Perhaps I have a bug in pg_ctrl? More likely you have the wrong value of PGDATA in your environment (where wrong means not what that postmaster is using). regards, tom lane ---(end of

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Arne Stoelck
How about a simple telnet localhost 5432 ? assuming postmaster is listening on that host and port On Fri, 17 Sep 2004, 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

[SQL] How to check postgres running or not ?

2004-09-18 Thread Sandeep Gaikwad
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.

Re: [SQL] How to check postgres running or not ?

2004-09-18 Thread Christopher Browne
In an attempt to throw the authorities off his trail, [EMAIL PROTECTED] (Sandeep Gaikwad) transmitted: 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

Re: [SQL] How to check postgres running or not ?

2004-09-18 Thread Gaetano Mendola
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 ? Well, in

Re: [SQL] How to check postgres running or not ?

2004-09-18 Thread Worik
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 ?SSep07 0:31 /usr/lib/postgresql/bin/postmaster postgres 887 0.0 0.2 9536 612 ?SSep07