Very misleading documentation for PQreset() - Mailing list pgsql-hackers

From Tom Lane
Subject Very misleading documentation for PQreset()
Date
Msg-id 1095901.1611268376@sss.pgh.pa.us
Whole thread Raw
Responses Re: Very misleading documentation for PQreset()  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: James Hilliard
Date:
Subject: Re: [PATCH 1/1] Fix detection of pwritev support for OSX.
Next
From: Andres Freund
Date:
Subject: Re: Avoiding smgrimmedsync() during nbtree index builds