pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Barry Lind <blind@xythos.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Cc: pgsql-interfaces@postgresql.org
Subject: Re: First draft of new FE/BE protocol spec posted for comments
Date: Thu, 24 Apr 2003 10:29:03 -0700
Message-ID: <3EA81EDF.9030306@xythos.com> (raw)
In-Reply-To: <9278.1051139337@sss.pgh.pa.us>
References: <10770.1050448110@sss.pgh.pa.us>
	<3EA6D372.3000406@xythos.com>
	<9278.1051139337@sss.pgh.pa.us>



Tom Lane wrote:
> Barry Lind <blind@xythos.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




view thread (12+ messages)

Message-ID: <3EA81EDF.9030306@xythos.com>
Permalink:  ../3EA81EDF.9030306@xythos.com/
Also on:    postgresql.org/message-id/3EA81EDF.9030306@xythos.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: blind@xythos.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: First draft of new FE/BE protocol spec posted for comments
  In-Reply-To: <3EA81EDF.9030306@xythos.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox