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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-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

Browse pgsql-hackers by date

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

Browse pgsql-jdbc by date

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