X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5C9C99FA6B3 for ; Wed, 7 Jun 2006 13:05:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 37546-01 for ; Wed, 7 Jun 2006 13:05:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from marsha.pcisys.net (marsha.pcisys.net [216.229.32.146]) by postgresql.org (Postfix) with ESMTP id 5A5469FA6B2 for ; Wed, 7 Jun 2006 13:05:38 -0300 (ADT) Received: from [192.168.0.101] (dsl-206-53-17-71.cos.pcisys.net [206.53.17.71]) by marsha.pcisys.net (8.13.3/8.13.3) with ESMTP id k57G5ZR5027679; Wed, 7 Jun 2006 10:05:36 -0600 (MDT) User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Wed, 07 Jun 2006 10:05:32 -0600 Subject: Re: libpq PQexecParams and arrays From: Keary Suska To: Alexey Slynko CC: Postgres-Interfaces Message-ID: In-Reply-To: <44869432.40200@tronet.ru> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/7 X-Sequence-Number: 6148 on 6/7/06 2:54 AM, slynko@tronet.ru purportedly said: >>> I wish to call PQexecParams with array of uint32_t values. >>> I've tried to use example from src/test/examples/testlibpq3.c, but with >>> no effect - it's unusable for input array. >>> >>> Have anyone an idea, how it can be done? >> >> Have you tried passing all parameters, including especially the appropriate >> paramTypes and paramFormats parameters? > Of course > >> I believe that doing this should >> permit libpq to understand binary data. > No, it doesn't. > I've found, that array parsed at the server side by array_recv function. > Is there is a way to send an array of arbitrary type by libpq? To make sure that I understand, do you mean passing a paramValues as an array of uint32, or passing values to a *column* that is an array column? If it's the latter (array column), I don't think libpq supports array columns in this way. If it is just a matter of passing binary numeric values, I thought it was supported by libpq, but maybe not. The documentation is ambiguous in many places, so it is possible that libpq's binary support is only for blobs and not for other data types. I have never tried passing binary data, as I tend to find it easier in my applications to pass textual representations, so I can't say for sure. You may have to "convert" your int array into an array of char. Best, Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business"