pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedVery misleading documentation for PQreset()
2+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2021-01-22 ab66645628 35a7eef08a 878cf600e3 a5f7b837f3 0d6903ecd9 Doc: remove misleading claim in documentation of PQreset().
* Very misleading documentation for PQreset()
@ 2021-01-21 22:32 Tom Lane <tgl@sss.pgh.pa.us>
2021-01-22 06:32 ` Re: Very misleading documentation for PQreset() Noah Misch <noah@leadboat.com>
0 siblings, 1 reply; 2+ messages in thread
From: Tom Lane @ 2021-01-21 22:32 UTC (permalink / raw)
To: pgsql-hackers@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Very misleading documentation for PQreset()
2021-01-21 22:32 Very misleading documentation for PQreset() Tom Lane <tgl@sss.pgh.pa.us>
@ 2021-01-22 06:32 ` Noah Misch <noah@leadboat.com>
0 siblings, 0 replies; 2+ messages in thread
From: Noah Misch @ 2021-01-22 06:32 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@lists.postgresql.org
On Thu, Jan 21, 2021 at 05:32:56PM -0500, Tom Lane wrote:
> 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.
I agree that dropping the phrase strictly improves that documentation.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2021-01-22 06:32 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 22:32 Very misleading documentation for PQreset() Tom Lane <tgl@sss.pgh.pa.us>
2021-01-22 06:32 ` Noah Misch <noah@leadboat.com>
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