X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id CC4A79DC835 for ; Thu, 15 Dec 2005 18:54:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91339-07 for ; Thu, 15 Dec 2005 18:54:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B7EEB9DC81B for ; Thu, 15 Dec 2005 18:54:21 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jBFMsLsi017891; Thu, 15 Dec 2005 17:54:21 -0500 (EST) To: Kris Jurka cc: Assad Jarrahian , pgsql-jdbc@postgresql.org Subject: Re: an efficient way of checking if the connection to a db In-reply-to: References: <4bd3e1480512151247u50479082vd08b9a1563d54604@mail.gmail.com> <17552.1134685460@sss.pgh.pa.us> Comments: In-reply-to Kris Jurka message dated "Thu, 15 Dec 2005 17:41:23 -0500" Date: Thu, 15 Dec 2005 17:54:21 -0500 Message-ID: <17890.1134687261@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.003 required=5 tests=[AWL=0.003] X-Spam-Score: 0.003 X-Spam-Level: X-Archive-Number: 200512/68 X-Sequence-Number: 14399 Kris Jurka writes: > Testing this with the V2 protocol reveals an issue, but it looks like > the server's fault. > 14:33:42.550 (1) FE=> Query("") > 14:33:42.550 (1) <=BE EmptyQuery > At this point the driver is waiting for ReadyForQuery, but the server is > waiting for another query. I think you've got a problem on the driver side. Here, strace'ing a program doing PQexec(conn, "") shows: 17:53:33.677241 send(3, "Q\0\0\0\5\0", 6, 0) = 6 ... 17:53:33.678085 recv(3, "I\0\0\0\4Z\0\0\0\5I", 16384, 0) = 11 which looks like EmptyQueryResponse followed by ReadyForQuery to me. regards, tom lane