Re: bytea and character encoding when inserting escaped literals

From: Asche <asche(dot)public(at)mac(dot)com>
To: Lee Feigenbaum <lee(at)thefigtrees(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: bytea and character encoding when inserting escaped literals
Date: 2008-05-05 15:37:22
Message-ID: 208D01DB-7F10-454B-BB71-41321ABCF95F@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Lee,

> Thanks for the suggestion. I should have mentioned in my original
> message that as per your suggestion and the suggestion in the
> documentation, I have tried escaping the backslashes. When I do
> this, I get the error:
>
> ERROR: invalid input syntax for type bytea
>
> I tried also doing
>
> INSERT INTO myTable VALUES (..., E'\\x15\\x1C\\x2F\\x00\
> \x02...'::bytea, ...) ;
>
> but get the same errors.

I think i see another problem with your query. You should convert to
three-digit octal (something like \\001\\002...) not \\x01 (hex?).

Jan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andy Anderson 2008-05-05 15:42:27 Re: bytea and character encoding when inserting escaped literals
Previous Message Lee Feigenbaum 2008-05-05 15:30:29 Re: bytea and character encoding when inserting escaped literals