Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C40686349F8 for ; Tue, 7 Apr 2009 17:08:39 -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 18089-07 for ; Tue, 7 Apr 2009 17:08:32 -0300 (ADT) X-Greylist: delayed 00:14:08.647403 by SQLgrey-1.7.6 Received: from mk-filter-3-a-1.mail.uk.tiscali.com (mk-filter-3-a-1.mail.uk.tiscali.com [212.74.100.54]) by mail.postgresql.org (Postfix) with ESMTP id DFC5D6336A1 for ; Tue, 7 Apr 2009 17:08:28 -0300 (ADT) X-Trace: 175375732/mk-filter-3.mail.uk.tiscali.com/B2C/$b2c-THROTTLED-DYNAMIC/b2c-CUSTOMER-DYNAMIC-IP/80.225.10.93/None/john.lister@kickstone.com X-SBRS: None X-RemoteIP: 80.225.10.93 X-IP-MAIL-FROM: john.lister@kickstone.com X-MUA: Thunderbird 2.0.0.21 (Windows/20090302) X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao0BAINL20lQ4Qpd/2dsb2JhbAAIzyWDewY X-IronPort-AV: E=Sophos;i="4.39,338,1235952000"; d="scan'208";a="175375732" Received: from 80-225-10-93.dynamic.dial.as9105.com (HELO [192.168.6.11]) ([80.225.10.93]) by smtp.tiscali.co.uk with ESMTP; 07 Apr 2009 20:54:18 +0100 Message-ID: <49DBAF74.5020409@kickstone.com> Date: Tue, 07 Apr 2009 20:54:28 +0100 From: John Lister User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Merlin Moncure CC: Andrew Chernow , pgsql-hackers@postgresql.org Subject: Re: Array types References: <89DBB5874E89413698A8E275E5E79154@squarepi.com> <49DBA65B.9020706@esilo.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/385 X-Sequence-Number: 136488 Cheers, nice to know it is possible... Now to see if i can get java/python to do the same :) or to use a modified libpq somehow... Merlin Moncure wrote: > On Tue, Apr 7, 2009 at 3:35 PM, John Lister > wrote: > >> Does libpqtypes pass the array "over the wire" as an array? Ideally i'd like >> to do this with jdbc, but might give me a pointer... >> > > We send/receive the server's array format. This is not quite a C > array, and is definitely not a java array. It's a packed postgres > specific (network byte order) format. It is much faster and tighter > than text in some cases however. We present an interface to copy C > arrays to postgres style formats such as: > > PGarray a; > PQgetf(res, tuple_num, "%int4[]", field_num, &a); > > This will 'pop' a result out of your result that presents the array > internals (which you could then loop). > > merlin >