Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 2F1C01442C29 for ; Fri, 24 Feb 2012 17:48:29 -0400 (AST) Received: from sd.tpf.co.jp ([210.161.239.34]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1S1304-0001Wp-Q8 for pgsql-odbc@postgresql.org; Fri, 24 Feb 2012 21:48:28 +0000 Received: (qmail 15465 invoked by uid 512); 24 Feb 2012 21:48:07 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 24 Feb 2012 21:48:07 -0000 Received: from unknown (HELO ?192.168.24.54?) (183.76.20.202) by sd.tpf.co.jp with SMTP; 24 Feb 2012 21:48:07 -0000 Message-ID: <4F48058E.8010509@tpf.co.jp> Date: Sat, 25 Feb 2012 06:47:58 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Ganesh Borse CC: pgsql-odbc@postgresql.org Subject: Re: Request for help on retrieving binary data from bytea column using ODBC calls References: <4F4752F9.6010302@tpf.co.jp> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/13 X-Sequence-Number: 10776 (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