Re: PQ versions request message

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James William Pye <pgsql(at)jwp(dot)name>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PQ versions request message
Date: 2005-09-08 02:02:50
Message-ID: 2241.1126144970@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

James William Pye <pgsql(at)jwp(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2005-09-08 02:08:04 Re: initdb profiles
Previous Message Christopher Kings-Lynne 2005-09-08 01:54:59 Re: initdb profiles