From sunil@6dtech.co.in Tue Jul 22 15:52:10 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0E75B6502A1 for ; Tue, 22 Jul 2008 12:52:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 14995-01-2 for ; Tue, 22 Jul 2008 12:51:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp100.biz.mail.re2.yahoo.com (smtp100.biz.mail.re2.yahoo.com [206.190.52.46]) by postgresql.org (Postfix) with SMTP id C51D965039C for ; Tue, 22 Jul 2008 12:47:28 -0300 (ADT) Received: (qmail 11637 invoked from network); 22 Jul 2008 15:47:26 -0000 Received: from unknown (HELO STSBANWRK134) (sunil@6dtech.co.in@61.95.192.235 with login) by smtp100.biz.mail.re2.yahoo.com with SMTP; 22 Jul 2008 15:47:25 -0000 X-YMail-OSG: JNBM97sVM1kFVHzTNRtl9IF1ygkUsLOkU9mdU_H5DmrjzF53fDLr_SrwcbP5QERiS7eaVAt7d3Q4E46FtZtblmNvj8zmKuJpWoKftg_GsQ-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <001901c8ec12$66ad2990$be00a8c0@6dBangalore.co.in> From: "Sunil Khatri" To: Subject: PQstatus is getting blocked when database sytem powered off Date: Tue, 22 Jul 2008 21:18:32 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0016_01C8EC40.7EBF56B0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200807/14 X-Sequence-Number: 6772 This is a multi-part message in MIME format. ------=_NextPart_000_0016_01C8EC40.7EBF56B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, In my application I need to check connection status before executing the = query. I am doing it using PQstatus.=20 Problem is : PQstatus is getting blocked If the system on which database = server is running is powered off. If I shutdown the database using pg_ctl stop or pkill -9 postmaster in = that case its returning. Is there any other way to check the connection status in this case? Thanks=20 Sk ------=_NextPart_000_0016_01C8EC40.7EBF56B0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
In my application I need to check = connection status=20 before executing the query. I am doing it using PQstatus.
Problem is : PQstatus is getting = blocked If the=20 system on which database server is running is powered off.
If I shutdown the database using pg_ctl = stop or=20 pkill -9 postmaster in that case its returning.
 
Is there any other way to check the = connection=20 status in this case?
 
Thanks
Sk
 
------=_NextPart_000_0016_01C8EC40.7EBF56B0-- From tgl@sss.pgh.pa.us Tue Jul 22 20:09:09 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id AD6146507A3 for ; Tue, 22 Jul 2008 17:09:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 17489-02 for ; Tue, 22 Jul 2008 17:08:55 -0300 (ADT) Received: from mx3.hub.org (mx3.hub.org [206.223.169.73]) by postgresql.org (Postfix) with ESMTP id 596E86502DB for ; Tue, 22 Jul 2008 16:25:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mx3.hub.org (Postfix) with ESMTP id E6E0937C8E7 for ; Tue, 22 Jul 2008 14:30:27 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m6MHSkhJ000715; Tue, 22 Jul 2008 13:28:46 -0400 (EDT) To: "Sunil Khatri" cc: pgsql-interfaces@postgresql.org Subject: Re: PQstatus is getting blocked when database sytem powered off In-reply-to: <001901c8ec12$66ad2990$be00a8c0@6dBangalore.co.in> References: <001901c8ec12$66ad2990$be00a8c0@6dBangalore.co.in> Comments: In-reply-to "Sunil Khatri" message dated "Tue, 22 Jul 2008 21:18:32 +0530" Date: Tue, 22 Jul 2008 13:28:46 -0400 Message-ID: <714.1216747726@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/15 X-Sequence-Number: 6773 "Sunil Khatri" writes: > Problem is : PQstatus is getting blocked If the system on which database server is running is powered off. Hardly likely, considering that PQstatus is just ConnStatusType PQstatus(const PGconn *conn) { if (!conn) return CONNECTION_BAD; return conn->status; } I have no doubt that a query-issuing call could get blocked if the postmaster stops responding, but not PQstatus. regards, tom lane From sunil@6dtech.co.in Wed Jul 23 06:47:18 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5173864FCE4 for ; Wed, 23 Jul 2008 03:47:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18615-01 for ; Wed, 23 Jul 2008 03:47:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp107.biz.mail.re2.yahoo.com (smtp107.biz.mail.re2.yahoo.com [206.190.52.176]) by postgresql.org (Postfix) with SMTP id DA2B964FCCC for ; Wed, 23 Jul 2008 03:47:14 -0300 (ADT) Received: (qmail 12038 invoked from network); 23 Jul 2008 06:47:13 -0000 Received: from unknown (HELO STSBANWRK134) (sunil@6dtech.co.in@61.95.192.235 with login) by smtp107.biz.mail.re2.yahoo.com with SMTP; 23 Jul 2008 06:47:12 -0000 X-YMail-OSG: ZJTv_ogVM1mj4UmKKVs_GDv7IR4likYbf.RmtVjJo2Lue_RYBVyE8zmi5U4TbxcWsnW7y_kCSF3xNuBPTGVrEDfdtH9msvIl2bi1eDdjmh68EKZ6WDtWi.6pvNZAmnI- X-Yahoo-Newman-Property: ymail-3 Message-ID: <009501c8ec90$18bf11c0$be00a8c0@6dBangalore.co.in> From: "Sunil Khatri" To: "Tom Lane" Cc: References: <001901c8ec12$66ad2990$be00a8c0@6dBangalore.co.in> <714.1216747726@sss.pgh.pa.us> Subject: Re: PQstatus is getting blocked when database sytem powered off Date: Wed, 23 Jul 2008 12:18:18 +0530 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=STOX_REPLY_TYPE=0.001 X-Spam-Level: X-Archive-Number: 200807/16 X-Sequence-Number: 6774 Thanks for your reply. You are right PQstatus is not blocking, query-issuing call is getting blocked. Is there any way for handling this blocking situation? Regards Sk ----- Original Message ----- From: "Tom Lane" To: "Sunil Khatri" Cc: Sent: Tuesday, July 22, 2008 10:58 PM Subject: Re: [INTERFACES] PQstatus is getting blocked when database sytem powered off > "Sunil Khatri" writes: >> Problem is : PQstatus is getting blocked If the system on which database >> server is running is powered off. > > Hardly likely, considering that PQstatus is just > > ConnStatusType > PQstatus(const PGconn *conn) > { > if (!conn) > return CONNECTION_BAD; > return conn->status; > } > > > I have no doubt that a query-issuing call could get blocked if the > postmaster stops responding, but not PQstatus. > > regards, tom lane > > -- > Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-interfaces > > > -- > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 270.5.3/1565 - Release Date: 7/21/2008 > 6:36 PM > >