Re: Is it time to kill support for very old servers? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is it time to kill support for very old servers?
Date
Msg-id 12021.1475856377@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is it time to kill support for very old servers?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Is it time to kill support for very old servers?  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Oct 7, 2016 at 11:34 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Greg Stark <stark@mit.edu> writes:
>>> For another there may be binary-only applications or drivers out there
>>> that are using V2 for whatever reason.

>> The problem with letting it just sit there is that we're not, in fact,
>> testing it.  If we take the above argument seriously then we should
>> provide some way to configure libpq to prefer V2 and run regression
>> tests in that mode.  Otherwise, if/when we break it, we'll never know it
>> till we get field reports.

> I agree with that.  I think it would be fine to keep V2 support if
> somebody wants to do the work to let us have adequate test coverage,
> but if nobody volunteers I think we might as well rip it out.  I don't
> particularly enjoy committing things only to be told that they've
> broken something I can't test without unreasonable effort.

When I wrote the above I was thinking of an essentially user-facing
libpq feature, similar to the one JDBC has, to force use of V2 protocol.
But actually, for testing purposes, I don't think that's what we want.
Any such feature would fail to exercise libpq's logic for falling back
from V3 to V2 when it connects to an old server, which is surely something
we'd like to test without actually having a pre-7.4 server at hand.

So what I'm thinking is it'd be sufficient to do something like
this in pqcomm.h:

+#ifndef FORCE_OLD_PROTOCOL#define PG_PROTOCOL_LATEST        PG_PROTOCOL(3,0)
+#else /* make like a pre-7.4 server for testing purposes */
+#define PG_PROTOCOL_LATEST        PG_PROTOCOL(2,0)
+#endif

which would cause the server to reject 3.0 requests just as if it were
ancient.  Then we could test with that #define, maybe have a buildfarm
critter doing it.  (This might break pqmq.c though, so we might need
to work slightly harder than this.)

Also, I realized while perusing this that the server still has support
for protocol 1.0 (!).  That's *definitely* dead code.  There's not much
of it, but still, I'd rather rip it out than continue to pretend it's
supported.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Question about pg_control usage
Next
From: Tom Lane
Date:
Subject: Re: Radix tree for character conversion