Re: select on bytea column returns hex encoded data instead of binary data

Поиск
Список
Период
Сортировка
От ktm@rice.edu
Тема Re: select on bytea column returns hex encoded data instead of binary data
Дата
Msg-id 20120222140715.GF21114@aart.rice.edu
обсуждение исходный текст
Ответ на select on bytea column returns hex encoded data instead of binary data  (Ganesh Borse <bganesh05@gmail.com>)
Ответы Re: select on bytea column returns hex encoded data instead of binary data  (Ganesh Borse <bganesh05@gmail.com>)
Список pgsql-novice
On Wed, Feb 22, 2012 at 11:02:16AM +0800, Ganesh Borse wrote:
> Hi,
>
> I am new to postgresql.
>
> I've an application which displays the various binary files (like jpgs,
> xls, zips) stored in PostgrelSQL DB in bytea column.
>
> I inserted these files in bytea column in a table using hex encoding.
>
> But, when I try to access this column by executing (SQLExec) the query
> "select * from tablename;" from ODBC on Windows, the buffer contains the
> same hex encoded data.
>
> I am using SQL_C_BINARY data type for SQLBindCol() function.
>
> Can you please help me know, how can I retrieve the data stored in bytea
> columns in binary format?
>
> Thanks in advance for help and guidance.
>
> Best Regards,
> Ganesh

It sounds like ODBC is not using binary mode for the result retrieval but
is using text which results in either hex or escape encoding as you see.
You will need to find someone to help you with ODBC on Windows.

Regards,
Ken

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

Предыдущее
От: "ZXAEGAKKA001, ext"
Дата:
Сообщение: Export Control Classification Number (ECCN) Request
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Export Control Classification Number (ECCN) Request