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 552369FA3AD for ; Wed, 7 Jun 2006 13:39:28 -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 46555-01 for ; Wed, 7 Jun 2006 13:39:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6F36B9FA2E6 for ; Wed, 7 Jun 2006 13:39:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k57Gd4ih000929; Wed, 7 Jun 2006 12:39:04 -0400 (EDT) To: Keary Suska cc: Alexey Slynko , Postgres-Interfaces Subject: Re: libpq PQexecParams and arrays In-reply-to: References: Comments: In-reply-to Keary Suska message dated "Wed, 07 Jun 2006 10:05:32 -0600" Date: Wed, 07 Jun 2006 12:39:04 -0400 Message-ID: <927.1149698344@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/8 X-Sequence-Number: 6149 Keary Suska writes: > 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 you're trying to pass a binary parameter value to an array column, you have to create the correct struct representing an array datatype, as expected by array_recv. This implies making the appropriate array header and (for integer data) converting each value to big-endian byte order. A plain C uint32[] array definitely hasn't got the header, and on Intel platforms it's the wrong byte order too. There is not anything built into libpq that will do the translation for you. regards, tom lane