Re: Reading bytea field

Поиск
Список
Период
Сортировка
От Volkan YAZICI
Тема Re: Reading bytea field
Дата
Msg-id 7104a7370510211630s294123f6te3465b593c5e32a9@mail.gmail.com
обсуждение исходный текст
Ответ на Reading bytea field  ("Jochen Kokemüller" <jochen@kokemueller.de>)
Список pgsql-interfaces
Hi,

On 10/21/05, Jochen Kokemüller <jochen@kokemueller.de> wrote:
> I read that it is better to use PQexecParams instead of PQescape. In the
> bytea field is then the picture with every Byte escaped. So the first
> few bytes look like this:
>
>  \377\330\377\340\000\020JFIF ...
>
> I wouldn't bother if i knew how to unescape this sequence. I supposed
> that this is more or less an internal representation, but when i try to
> retrieve the data. i get it like this.

If you'd use PQexecParams() for SELECT query with resultType = 1, you
shouldn't have any problem. Take a look at the examples in the
attachment.

Вложения

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

Предыдущее
От: "Stefan T. Peters"
Дата:
Сообщение: Re: libpq won't connect when client is built with MinGW
Следующее
От: "Stefan T. Peters"
Дата:
Сообщение: libpq won't connect when client is built with MinGW