[HACKERS] API like mysql_ping

2005-08-25 Thread Sivakumar K
Do we have an API like mysql_ping to check whether the server is up and running after the connection has been established? I checked the PostgreSQL docs but of no use. Is there any work around for this? Regards, Siva Kumar.K

Re: [HACKERS] API like mysql_ping

2005-08-25 Thread Christopher Kings-Lynne
PQstatus perhaps? http://www.postgresql.org/docs/8.0/interactive/libpq-status.html Chris Sivakumar K wrote: Do we have an API like mysql_ping to check whether the server is up and running after the connection has been established? I checked the PostgreSQL docs but of no use. Is

Re: [HACKERS] API like mysql_ping

2005-08-25 Thread Andreas Pflug
Christopher Kings-Lynne wrote: PQstatus perhaps? http://www.postgresql.org/docs/8.0/interactive/libpq-status.html This only returns the last status, not the current. pgAdmin uses SELECT 1 for this. Regards, Andreas ---(end of broadcast)--- TIP

Re: [HACKERS] API like mysql_ping

2005-08-25 Thread Oliver Jowett
Sivakumar K wrote: Do we have an API like mysql_ping to check whether the server is up and running after the connection has been established? At the protocol level, you could send Sync and wait for ReadyForQuery. -O ---(end of broadcast)--- TIP

Re: [HACKERS] API like mysql_ping

2005-08-25 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 PQstatus perhaps? http://www.postgresql.org/docs/8.0/interactive/libpq-status.html This only returns the last status, not the current. pgAdmin uses SELECT 1 for this. Better still: PQtransactionStatus, followed by a quick PQexec of SELECT

Re: [HACKERS] API like mysql_ping

2005-08-25 Thread Tom Lane
Oliver Jowett [EMAIL PROTECTED] writes: Sivakumar K wrote: Do we have an API like mysql_ping to check whether the server is up and running after the connection has been established? At the protocol level, you could send Sync and wait for ReadyForQuery. At the client level, the easiest thing