Skip site navigation (1) Skip section navigation (2)

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

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: Ganesh Borse <bganesh05(at)gmail(dot)com>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Request for help on retrieving binary data from bytea column using ODBC calls
Date: 2012-02-24 21:47:58
Message-ID: 4F48058E.8010509@tpf.co.jp (view raw or flat)
Thread:
Lists: pgsql-odbc
(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

In response to

Responses

pgsql-odbc by date

Next:From: Ganesh BorseDate: 2012-02-28 02:54:56
Subject: Re: Request for help on retrieving binary data from bytea column using ODBC calls
Previous:From: Ganesh BorseDate: 2012-02-24 09:56:45
Subject: Re: Request for help on retrieving binary data from bytea column using ODBC calls

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group