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

From: Barry Lind <blind(at)xythos(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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-24 17:29:03
Message-ID: 3EA81EDF.9030306@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Tom Lane wrote:
> Barry Lind <blind(at)xythos(dot)com> writes:
>>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.
>
> I'd do it the other way: send a 3.0 connection request and then, if you
> get a "bad protocol" error response, send a 2.0 connection request.
> You do have to be a little careful about parsing the connection response
> since if it's 'E' it might be either 2.0 or 3.0 layout, but that can be
> handled without too much difficulty I think. (Look at the
> already-committed code in libpq's fe-connect.c.)
>
OK. So this is what I plan to do:
First try a 3.0 connection.
If an error response is received from the connection attempt then check
if the error is in a 3.0 format, if yes then report the error, else if
not 3.0 format then try a 2.0 connection, if that returns an error then
report it.

thanks,
--Barry

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ohp 2003-04-24 17:31:23 Re: pg_dump dumping... core
Previous Message ohp 2003-04-24 16:45:30 Re: pg_dump dumping... core

Browse pgsql-interfaces by date

  From Date Subject
Next Message Stéphane Pinel 2003-04-24 17:43:29 get the data size of a large object
Previous Message Fabian Peters 2003-04-24 12:34:36 PL/Tcl: internal error - cannot create 'normal' interpreter