Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 6934C6331C5 for ; Wed, 8 Apr 2009 13:03:15 -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 68660-01 for ; Wed, 8 Apr 2009 13:03:12 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id B067163307D for ; Wed, 8 Apr 2009 13:03:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mx1.hub.org (Postfix) with ESMTP id 7481C125A69A for ; Wed, 8 Apr 2009 13:03:10 -0300 (ADT) Received: from [192.168.1.204] (adsl-71-128-101-241.dsl.irvnca.pacbell.net [71.128.101.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail63.csoft.net (Postfix) with ESMTP id 8E3242841D; Wed, 8 Apr 2009 12:03:08 -0400 (EDT) Message-ID: <49DCCAAA.3080604@ejurka.com> Date: Wed, 08 Apr 2009 09:02:50 -0700 From: Kris Jurka User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: John Lister CC: pgsql-jdbc@postgresql.org Subject: Re: Array passing References: <491f66a50904070817o3af217d4odc32bdfd29b47789@mail.gmail.com> <49DBBF8D.2080806@kickstone.com> In-Reply-To: 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=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/35 X-Sequence-Number: 19482 John Lister wrote: > I've applied the patch, but there seems to be a couple of issues. > > To do binary transfer, it needs to do a describe before the bind so as > to get the returned field types. This seems to only be done when > ForceBinaryTransfer is set. > My memory of what the patch does is a little fuzzy and I've only looked at the binary receive patch, but here's how I understood it. The current driver execution does not bother retrieving the describe results before executing a query. This means we don't know what types will be returned beforehand, so we don't know if we can support retrieving them in binary and must retrieve them as text. This is done to avoid an extra network roundtrip for query execution. What the patch does is to look at a prepared statement and see if we've already prepared it. If we have, then we have the previous describe results and know what fields we can handle as binary. So without ForceBinaryTransfer, binary will only kick in on the second execution (or perhaps prepareThreshold executions, I forget). ForceBinaryTransfer is really a hack to test this which prepares a query twice to make this work, so don't be fooled by the first preparation and wait for the second one. > Secondly when it does the describe, sendParse trashes the fields details > by setting them to null before the main query is executed. > I'm not sure what you're referring to specifically. sendParse certainly doesn't adjust any of the params that are passed in, and it doesn't touch anything if the query is already prepared. > Did this patch use to work, i can't see how in its current form. > It did work and I have no reason to believe that's changed. Perhaps it just isn't working as you're expecting. Perhaps you're trying it with arrays which it might not support? I'd try getting it working with a plain int or two first. Kris Jurka