Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 84540632886 for ; Tue, 7 Apr 2009 16:15:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33903-02 for ; Tue, 7 Apr 2009 16:15:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.esilo.com (updates.esilo.com [63.150.152.211]) by mail.postgresql.org (Postfix) with ESMTP id BD22563280E for ; Tue, 7 Apr 2009 16:15:25 -0300 (ADT) Received: from [10.0.0.2] (fwext-esilo-jupiter.esilo.com [64.135.45.146]) (authenticated bits=0) by mail.esilo.com (8.13.1/8.13.1) with ESMTP id n37JF5N2022017 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Apr 2009 15:15:06 -0400 Message-ID: <49DBA65B.9020706@esilo.com> Date: Tue, 07 Apr 2009 15:15:39 -0400 From: Andrew Chernow User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: John Lister CC: pgsql-hackers@postgresql.org Subject: Re: Array types References: <89DBB5874E89413698A8E275E5E79154@squarepi.com> In-Reply-To: <89DBB5874E89413698A8E275E5E79154@squarepi.com> Content-Type: text/plain; charset=UTF-8; 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/376 X-Sequence-Number: 136479 John Lister wrote: > They all return arrays as text, is it possible to configure postgresql > to return an array in native form (does postgresql support such a > thing)? This is using both the simple and extended query forms - i > couldn't see a way to say what return type i wanted in the protocol docs... > You need libpqtypes (client-side library). It requires a new 8.4 feature called libpq-events, but there is an 8.3 patch available. If you willing to patch your 8.3.5 libpq client, than this should meet your needs. Downloads: http://pgfoundry.org/projects/libpqtypes/ Documentation: http://libpqtypes.esilo.com/ For arrays, libpqtypes gives you a PGresult where each tuple is an array item. For composite arrays, each composite field is a PGresult field. > This would seem much better in terms of performance, both size and > speed(conversion). > That is true. Our testing has proven this. It also reduces the overall coding effort. -- Andrew Chernow eSilo, LLC every bit counts http://www.esilo.com/