Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2iVg-0008HJ-Hb for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 22:33:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2iVf-0006JW-Fi for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 22:32:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2iVf-0006JO-91 for pgsql-hackers@lists.postgresql.org; Thu, 21 Jan 2021 22:32:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2iVd-0004H2-9B for pgsql-hackers@lists.postgresql.org; Thu, 21 Jan 2021 22:32:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 10LMWuuS1095902 for ; Thu, 21 Jan 2021 17:32:56 -0500 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: Very misleading documentation for PQreset() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1095900.1611268376.1@sss.pgh.pa.us> Date: Thu, 21 Jan 2021 17:32:56 -0500 Message-ID: <1095901.1611268376@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I happened to notice that PQreset is documented thus: This function will close the connection to the server and attempt to reestablish a new connection to the same server, using all the same parameters previously used. Since we invented multi-host connection parameters, a reasonable person would assume that "to the same server" means we promise to reconnect to the same host we selected the first time. There is no such guarantee though; the new connection attempt is done just like the first one, so it will select the first suitable server in the list. I think we should just drop that phrase. Alternatively we could decide that the code's behavior is buggy, but I don't think it is. If, say, the reason you need to reset is that your existing host died, you don't really want libpq to refuse to select an alternative server. regards, tom lane