pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <inoue@tpf.co.jp>
To: Ganesh Borse <bganesh05@gmail.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Request for help on retrieving binary data from bytea column using ODBC calls
Date: Sat, 25 Feb 2012 06:47:58 +0900
Message-ID: <4F48058E.8010509@tpf.co.jp> (raw)
In-Reply-To: <CAEhYC0GMf0avVRG4vcgs_gXBboRYD_PCLE-jkLW+YcO=QmpmEw@mail.gmail.com>
References: <CAEhYC0HOec=cZQG6C3HWAWNGR8R-dhrdtQwH2xBhdW8AuHG1XA@mail.gmail.com>
	<4F4752F9.6010302@tpf.co.jp>
	<CAEhYC0GMf0avVRG4vcgs_gXBboRYD_PCLE-jkLW+YcO=QmpmEw@mail.gmail.com>

(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



view thread (9+ messages)  latest in thread

Message-ID: <4F48058E.8010509@tpf.co.jp>
Permalink:  ../4F48058E.8010509@tpf.co.jp/
Also on:    postgresql.org/message-id/4F48058E.8010509@tpf.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: inoue@tpf.co.jp, bganesh05@gmail.com
  Subject: Re: Request for help on retrieving binary data from bytea column using ODBC calls
  In-Reply-To: <4F48058E.8010509@tpf.co.jp>
  References: <CAEhYC0HOec=cZQG6C3HWAWNGR8R-dhrdtQwH2xBhdW8AuHG1XA@mail.gmail.com> <4F4752F9.6010302@tpf.co.jp> <CAEhYC0GMf0avVRG4vcgs_gXBboRYD_PCLE-jkLW+YcO=QmpmEw@mail.gmail.com> <4F48058E.8010509@tpf.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox