Re: Image Insert Postgresql DB - Mailing list pgsql-sql

From Kenneth Gonsalves
Subject Re: Image Insert Postgresql DB
Date
Msg-id 0411231310270N.01150@thenilgiris.com
Whole thread Raw
In response to Image Insert Postgresql DB  (sreejith s <getsreejith@gmail.com>)
List pgsql-sql
On Tuesday 23 November 2004 12:48 pm, Premsun Choltanwanich wrote:
> I face this same problem when I try to insert image by lo_import to
> database with my client files. I already change the way to bytea data
> type but it's not work. The error return like type mismatch when I try
> to insert it from Binary variable.
>
> Why I cannot insert it? If anybody found some solution please reply on
> this topic for me too.

you must escape the octets with \\ that is two backslashes and not one 
backslash.

for example if your binary data is like this:

\x05\x00\x02

you must make it like so:

\\x05\\x00\\x02

please see chapter 8.4 of the postgresql manual. 

kg


pgsql-sql by date:

Previous
From: "Premsun Choltanwanich"
Date:
Subject: Re: Image Insert Postgresql DB
Next
From: "Premsun Choltanwanich"
Date:
Subject: Re: Image Insert Postgresql DB