Re: Request for help on retrieving binary data from bytea column using ODBC calls

Поиск
Список
Период
Сортировка
От Ganesh Borse
Тема Re: Request for help on retrieving binary data from bytea column using ODBC calls
Дата
Msg-id CAEhYC0HC=6C312P3CNgwmFwRDLcG=2y_b6+0zkULkpFufa_QWA@mail.gmail.com
обсуждение исходный текст
Ответ на Request for help on retrieving binary data from bytea column using ODBC calls  (Ganesh Borse <bganesh05@gmail.com>)
Ответы Re: Request for help on retrieving binary data from bytea column using ODBC calls  ("Inoue, Hiroshi" <inoue@tpf.co.jp>)
Список pgsql-odbc
Hi,

I am using the following PostgreSQL ODBC Windows driver:

PostgreSQL 64bit 8.03.04.00 PSQLODBC_X64_RELEASE.DLL 8/3/2009 -- the one which got installed with PostgreSQL 9.0 server that I downloaded from PostgreSQL website.

Thanks,

On Mon, Feb 27, 2012 at 4:30 PM, Ganesh Borse <bganesh05@gmail.com> wrote:
Log is as below:
 cf11e0a1b11ae1000000000000000000000000000000003b000300feff0900060000000000000000000000010000006a00000000000000001000006700000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Memory dump in VC++ debug window:
Address                     Hex Value
0x0000000000367850  a0 63 66 31 31 65 30 61 31 62 31 31 61 65 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 33 62 30 30 30 33 30 30 66 65   
cf11e0a1b11ae1000000000000000000000000000000003b000300fe
0x0000000000367889  66 66 30 39 30 30 30 36 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 31 30 30 30 30 30 30 36 61 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 31  ff0900060000000000000000000000010000006a00000000000000001
0x00000000003678C2  30 30 30 30 30 36 37 30 30 30 30 30 30 30 31 30 30 30 30 30 30 66 65 66 66 66 66 66 66 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 66 66 66 66 66 66 66 66 66 66 66 66  000006700000001000000feffffff0000000000000000ffffffffffff
0x00000000003678FB  66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66  fffffffffffffffffffffffffffffffffffffffffffffffffffffffff
0x0000000000367934  66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  fffffffffffffffffffffffffffff............................


On Sat, Feb 25, 2012 at 5:47 AM, Hiroshi Inoue <inoue@tpf.co.jp> wrote:
(2012/02/24 18:56), Ganesh Borse wrote:
Hi,

I used the steps same as outlined below:

    xxd -p /home/user/myimage.png | tr -d '\n' > /tmp/image.hex
    DELETE FROM hexdump; -- hexdump table is: -- CREATE TABLE hexdump
(hex text);
    COPY hexdump FROM '/tmp/image.hex';
    UPDATE users SET image= (SELECT decode(hex, 'hex') FROM hexdump
LIMIT 1) where id=15489

Is this the correct way of inserting binary data into bytea column?

When I fetch a small part of this column, I get output as below:

   select substring(smallblob,0,64) from longdata where blobi d=1;

 \xd0cf11e0a1b11ae1000000000000000000000000000000003b000300feff09000600000000000 00000000000010000006a0000000000000000100000670000 (1 row)

Looks OK to me.
Could you send me directly the Mylog output of the simple test case?

regards,
Hiroshi Inoue


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

Предыдущее
От: Hiroshi Inoue
Дата:
Сообщение: Re: Request for help on retrieving binary data from bytea column using ODBC calls
Следующее
От: "Inoue, Hiroshi"
Дата:
Сообщение: Re: Request for help on retrieving binary data from bytea column using ODBC calls