Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7D7F11337B97 for ; Sat, 2 Apr 2011 03:43:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 43942-09 for ; Sat, 2 Apr 2011 06:43:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id E87141337B47 for ; Sat, 2 Apr 2011 03:43:07 -0300 (ADT) Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 7880928460; Sat, 2 Apr 2011 02:43:07 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 2B9B6A3E4; Sat, 2 Apr 2011 02:43:07 -0400 (EDT) Date: Sat, 2 Apr 2011 02:43:06 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: bubba postgres cc: pgsql-jdbc@postgresql.org Subject: Re: JDBC4 Binary Mode with Arrays In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/9 X-Sequence-Number: 21735 On Fri, 1 Apr 2011, bubba postgres wrote: > In my current application I am sending a lot of data to/from the DB with > JDBC, and specifically arrays of Double. (or even Double[][]). > I have been converting everything into a string representation of the array > with StringBuffer, which eats a lot of memory. > > I note that there is this web page: > http://wiki.postgresql.org/wiki/JDBC-BinaryTransfer > > After trying out the JDBC4 driver in DBCP, I see that > Connection.createArray(...) still just creates a big string under the > covers. Is that the expected behavior? Am I doing it wrong? > Will the String get converted to binary representation again before hitting > the wire? > That page is about work in progress, not about the behavior of the production driver. So you are correct that the transfer is being done with string representation currently. Kris Jurka