pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Subject: Very misleading documentation for PQreset()
Date: Thu, 21 Jan 2021 17:32:56 -0500
Message-ID: <1095901.1611268376@sss.pgh.pa.us> (raw)

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





view thread (2+ messages)  latest in thread

Message-ID: <1095901.1611268376@sss.pgh.pa.us>
Permalink:  ../1095901.1611268376@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1095901.1611268376@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: Very misleading documentation for PQreset()
  In-Reply-To: <1095901.1611268376@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox