Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X05TV-0001nl-HD for pgsql-docs@arkaria.postgresql.org; Thu, 26 Jun 2014 08:56:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X05TU-0006MI-Sj for pgsql-docs@arkaria.postgresql.org; Thu, 26 Jun 2014 08:56:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X05TT-0006MB-R2 for pgsql-docs@postgresql.org; Thu, 26 Jun 2014 08:56:07 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X05TQ-0001Ck-Hj for pgsql-docs@postgresql.org; Thu, 26 Jun 2014 08:56:06 +0000 Received: from ayaki.localdomain (106-69-71-247.dyn.iinet.net.au [106.69.71.247]) by mrelayeu.kundenserver.de (node=mreue101) with ESMTP (Nemesis) id 0LgHVU-1WNRKf2IAG-00niry; Thu, 26 Jun 2014 10:56:02 +0200 Message-ID: <53ABE01D.7070206@2ndquadrant.com> Date: Thu, 26 Jun 2014 16:55:57 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: PostgreSQL Developers Subject: PQping docs note X-Enigmail-Version: 1.6 Content-Type: multipart/mixed; boundary="------------080707040902000604000306" X-Provags-ID: V02:K0:AafmFnLBN8XOUGBIqAUB2LjzfxNcYo0qaI0l50511cD 8ZMjsOY0MFMN7GOf4RkhGiZaF64CeBWOjhrE5SO57pRTIVoPsH g14MX7CFRE50885asvRYxZOn37MRaWv9jc6XGXvx6eDDSS0cUh 6SISK54smsH7G3OcB3vRfO+plJ3qJFC2ORQYw3hJNZLXdttHV7 EYpzOyyPHCJmDRN1cF7XF6slvqYvjCyAKDlM//kUFtf2XqyA8d qK0ylcf3h8+21Mn9Uzconxx2xO99gR09m8LYeDMmYet3+pXJJQ QSGOlGQ0gj1zewTr6EKCxH43ZK8yW04O/LXCJM5gU7Guj+QHdA yqnny3mYqTTjL+UeGlbam4NkezCUgL+fHV6pbbHR9 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org This is a multi-part message in MIME format. --------------080707040902000604000306 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all Here's a small docs change telling users that PQping isn't for connection testing - it makes a new connection. Also warn users that connection "testing" is futile and they should just handle errors. This came out of user feedback on the libpq docs by a new user. Should apply cleanly to master with "git am". -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --------------080707040902000604000306 Content-Type: text/x-patch; name="0001-PQping-pings-the-server-not-a-connection.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-PQping-pings-the-server-not-a-connection.patch" From 4ba9bca8a7cf6b72a9fae6b4ee8abb54d9ad8d8a Mon Sep 17 00:00:00 2001 From: Craig Ringer Date: Thu, 26 Jun 2014 16:53:02 +0800 Subject: [PATCH] PQping pings the server, not a connection Add a note to the docs telling people that you can't use PQping to test a connection, and you shouldn't test connections anyway. Added after user feedback on the docs indicated confusion about the purpose of PQping. --- doc/src/sgml/libpq.sgml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index e10ccec..f7baf6c 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -660,6 +660,18 @@ PGPing PQpingParams(const char * const *keywords, int expand_dbname); + + + + PQping is not for testing whether an existing connection is still + usable. It makes a new temporary connection to test if the server is + reachable. Instead of testing connections (which is inherently prone to + race conditions), just run your queries and retry the transaction if + the connection drops. + + + + The function returns one of the following values: -- 1.9.0 --------------080707040902000604000306 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs --------------080707040902000604000306--