From: Tom Lane <tgl@sss.pgh.pa.us>
To: Keary Suska <hierophant@pcisys.net>
Cc: Alexey Slynko <slynko@tronet.ru>
Cc: Postgres-Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: libpq PQexecParams and arrays
Date: Wed, 07 Jun 2006 12:39:04 -0400
Message-ID: <927.1149698344@sss.pgh.pa.us> (raw)
In-Reply-To: <C0AC556C.2B270%hierophant@pcisys.net>
References: <C0AC556C.2B270%hierophant@pcisys.net>
Keary Suska <hierophant@pcisys.net> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, hierophant@pcisys.net, slynko@tronet.ru
Subject: Re: libpq PQexecParams and arrays
In-Reply-To: <927.1149698344@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox