Re: Handling protocol not supported error message when

From: "Francisco Figueiredo Jr(dot)" <fxjrlists(at)yahoo(dot)com(dot)br>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Handling protocol not supported error message when
Date: 2003-07-12 23:52:04
Message-ID: 3F109F24.3050000@yahoo.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> "Francisco Figueiredo Jr." <fxjrlists(at)yahoo(dot)com(dot)br> writes:
>
>>I'm finishing the implementation of the protocol 3.0 and now I'm working
>>in how to connect to server using protocol 3.0 when the server doesn't
>>support it 7.3- .
>
>
> I'd suggest using the same methods libpq does. You do have to be
> prepared to accept an old-format error message.
>

Yes, I'm prepared, but the problem is how can I in advance know which
format the message is, as I'm expecing a 3 version and comes a 2 version
error message?
Uhmmmm, I could see in the following line in libpq how it does it:
if (beresp == 'E' && (msgLength < 8 || msgLength > 30000))

So this is how it checks ahead, if the value is very large, the
msgLength would be bigger than 30000 and this would mean a string error
and so the 2.0 version error message. I think I will get this approach too.

Thanks Tom Lane.

> regards, tom lane
>

--
Regards,

Francisco Figueiredo Jr.

------
"My grandfather once told me that there are two
kinds of people: those
who work and those who take the credit. He told me
to try to be in the
first group; there was less competition there."
- Indira Gandhi

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Maksim Likharev 2003-07-12 23:59:21 Re: [HACKERS] PG crash on simple query, story continues
Previous Message Dave Page 2003-07-12 23:13:56 Re: php with postgres