Re: First draft of new FE/BE protocol spec posted for comments

From: "Sander Steffann" <sander(at)steffann(dot)nl>
To: <pgsql-hackers(at)postgreSQL(dot)org>, <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: First draft of new FE/BE protocol spec posted for comments
Date: 2003-04-23 21:17:05
Message-ID: 000801c309dd$b1789d00$64c8a8c0@10ww.steffann.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Hi,

> My final question is more of an implementation question than comments on
> the protocol itself. Since the jdbc driver needs to be backwardly
> compatible with 7.3 and earlier servers that will speak the 2.0
> protocol, what is the recomended way to write the client so that it can
> 'detect' which protocol to use. The only thing I can think of is to
> start by sending a version 2 protocol message (which will work across
> all the database versions that jdbc will be supporting) then if it finds
> it it talking to a 7.4 server, close the connection and reconnect using
> the version 3 protocol. This will double connection time when
> connecting to a 7.4 server but is the only way I can think of to do
> this. Is there a better way that I am missing?

Since I guess there will be a lot more 7.4+ servers than older servers I
think you should at least try protocol v3 first, and if that fails try v2.
Try to keep it as fast as possible for the most used version.

Could be that that this isn't possible though. I don't know the protocol
well enough to be sure. Maybe its an idea to introduce a new messagetype at
protocol level with which the client can ask the server which protocol
versions it supports. That would make protocol changes a lot easier in the
future. And if the server doesn't understand that new messagetype you know
you are talking to a v2-only server :)

Bye
Sander

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Castle 2003-04-23 21:47:22 Re: default locale considered harmful? (was Re: Using index for "like 'ABC%'" type query)
Previous Message Hannu Krosing 2003-04-23 21:04:51 Re: bit strings - anyone working on them?

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-04-23 23:08:57 Re: First draft of new FE/BE protocol spec posted for comments
Previous Message Bruce Momjian 2003-04-23 18:15:59 Re: ECPG thread-safety