Skip site navigation (1) Skip section navigation (2)

Re: [JDBC] JDBC and Binary protocol error, for some statements

From: Maciek Sakrejda <msakrejda(at)truviso(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Radosław Smogura <rsmogura(at)softperience(dot)eu>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [JDBC] JDBC and Binary protocol error, for some statements
Date: 2010-11-25 18:20:34
Message-ID: AANLkTi=XV9XrKHbmdirxXMU2KaG=0pFV-Hr3KkwwLuss@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-jdbc
Okay, looking at the JDBC side of things, I think JDBC doesn't
actually need that information (since, it always used text results
before Radosław's patch--the previous binary support was for
parameters only, right?). From looking at QueryExecutorImpl
(specifically sendOneQuery), it's clear that it *does* need the
Describe before the Bind when using named prepared statements. I can't
quite follow why, but I think the upshot of this is that there is no
bug in either the JDBC driver or the backend. This is just a
limitation of the existing implementation in the JDBC driver that
Radosław would need to work around for binary result processing
(probably by storing the requested format somewhere and using that
instead of what comes back from Describe).

I think the lessons are (1) the bug is probably *not* in the
established library or backend code and (2) it's a little confusing
that the result codes for "I don't know what format this will be in"
and "this will be in text format" are aliased.

It's too late to do anything about the second one and it's only a minor quibble.

Thanks for the help in making sense of this.
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

In response to

pgsql-hackers by date

Next:From: Radosław SmoguraDate: 2010-11-25 18:56:36
Subject: Re: [JDBC] JDBC and Binary protocol error, for some statements
Previous:From: Bruce MomjianDate: 2010-11-25 18:11:44
Subject: Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running

pgsql-jdbc by date

Next:From: Radosław SmoguraDate: 2010-11-25 18:56:36
Subject: Re: [JDBC] JDBC and Binary protocol error, for some statements
Previous:From: Maciek SakrejdaDate: 2010-11-25 17:46:30
Subject: Re: [JDBC] JDBC and Binary protocol error, for some statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group