Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A8E33633919 for ; Thu, 22 Oct 2009 13:00:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 81119-04-2 for ; Thu, 22 Oct 2009 15:59:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp140.iad.emailsrvr.com (smtp140.iad.emailsrvr.com [207.97.245.140]) by mail.postgresql.org (Postfix) with ESMTP id 152FA632C9F for ; Thu, 22 Oct 2009 12:59:56 -0300 (ADT) Received: from relay4.r5.iad.mlsrvr.com (localhost [127.0.0.1]) by relay4.r5.iad.mlsrvr.com (SMTP Server) with ESMTP id 10C2BC1DD for ; Thu, 22 Oct 2009 11:59:55 -0400 (EDT) Received: by relay4.r5.iad.mlsrvr.com (Authenticated sender: david.wall-AT-yozons.com) with ESMTPSA id BAC0BC289 for ; Thu, 22 Oct 2009 11:59:53 -0400 (EDT) Message-ID: <4AE0817A.5010502@computer.org> Date: Thu, 22 Oct 2009 08:59:54 -0700 From: David Wall User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: pgsql-jdbc Subject: Re: JDBC with PG 8.4 bytea character escaping wire protocol References: <4ADDDFC7.3010900@computer.org> In-Reply-To: <4ADDDFC7.3010900@computer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.166 tagged_above=-10 required=5 tests=AWL=0.433, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/28 X-Sequence-Number: 20030 > Does the JDBC 4 driver for PG 8.4 escape each character of the bytea > type, or does it use a binary protocol? > > From another post, Merlin Moncure wrote, "libpq supports a binary > protocol mode which allows you to execute queries sending bytea > without escaping." Is that true of the JDBC driver? I'm concerned > about the data size expansion that would result for the wire protocol > when I use setBytes(). I tried downloading the JDBC source and must say it was complex enough to a newbie that I couldn't really determine the answer myself. Does anybody know if the JDBC driver with PG 8.4 communicates using a binary protocol for BYTEA transfers to/from or whether it sends escaped chars only? Or perhaps which classes handle the transfer of BYTEA to PG and receives BYTEA responses from PG? Thanks, David