Re: libpq PQexecParams and arrays

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: libpq PQexecParams and arrays
Дата
Msg-id 927.1149698344@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: libpq PQexecParams and arrays  (Keary Suska <hierophant@pcisys.net>)
Список pgsql-interfaces
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


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Keary Suska
Дата:
Сообщение: Re: libpq PQexecParams and arrays
Следующее
От: Tom Lane
Дата:
Сообщение: Re: libpq PQexecParams and arrays