Re: Libpq: PQunescapeBytea

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Libpq: PQunescapeBytea
Дата
Msg-id 20070322172202.17336
обсуждение исходный текст
Ответ на Libpq: PQunescapeBytea  ("CN" <cnliou9@fastmail.fm>)
Список pgsql-interfaces
    CN wrote:

> Question: Does it mean that there exist some functions being able to
> retrieve bytea columns in "binary format"? My understanding of its
> meaning is that these functions will automatically restore the data read
> from database to their original unescaped binary strings and thus
> PQescapeBytea needs not to be called. If it does, what are these
> functions? PQgetvalue appears to be not one of them I think.

There's no specific function but when you pass 1 to the
'resultFormat' parameter of PQexecParams(), its results are
returned in binary format.
Then PQgetvalue() will give you the address of the data and
PQgetlength() its size. When this data is of type bytea, no
conversion is required.

-- DanielPostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org


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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: Libpq: PQunescapeBytea
Следующее
От: "CN"
Дата:
Сообщение: Re: Libpq: PQunescapeBytea