Re: PQ versions request message - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PQ versions request message
Date
Msg-id 2241.1126144970@sss.pgh.pa.us
Whole thread Raw
In response to PQ versions request message  (James William Pye <pgsql@jwp.name>)
Responses Re: PQ versions request message
List pgsql-hackers
James William Pye <pgsql@jwp.name> writes:
> I have been writing a PQ client and I have come to think that a
> "supported PQ versions request startup packet" would be useful to client
> authors.

Given that it'd be guaranteed not to work with any existing server
versions, I find the usefulness a bit debatable...

In particular I disagree with the premise that clients should expend an
extra connection setup/teardown cycle to find out which protocol
versions the server supports.  We change protocol versions seldom enough
that I think the optimal strategy is "try the newest version you know
of, then back off one at a time until it works".  This is always optimal
if the server is newer than the client, and it's only pessimal if the
server is much older than the client --- how often does that happen?

To put it more concretely: there are currently only two protocol
versions in live use (V1 died a long time ago).  If you try V3 and then
V2, you will expend either one or two connection cycles, with the
average converging towards one as time passes and more people update
their servers.  If you probe for the right answer and then do it, you
will always expend two connection cycles.  That is a win how exactly?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_config/share_dir
Next
From: Tom Lane
Date:
Subject: Re: Attention PL authors: want to be listed in template table?