pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Keary Suska <hierophant@pcisys.net>
To: Alexey Slynko <slynko@tronet.ru>
Cc: Postgres-Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: libpq PQexecParams and arrays
Date: Wed, 07 Jun 2006 10:05:32 -0600
Message-ID: <C0AC556C.2B270%hierophant@pcisys.net> (raw)
In-Reply-To: <44869432.40200@tronet.ru>

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"




view thread (6+ messages)  latest in thread

Message-ID: <C0AC556C.2B270%hierophant@pcisys.net>
Permalink:  ../C0AC556C.2B270%25hierophant@pcisys.net/
Also on:    postgresql.org/message-id/C0AC556C.2B270%hierophant@pcisys.net

 · 

reply

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: hierophant@pcisys.net, slynko@tronet.ru
  Subject: Re: libpq PQexecParams and arrays
  In-Reply-To: <C0AC556C.2B270%hierophant@pcisys.net>

* 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