Re: Problem inserting binary data in bytea column of UTF-8 database

From: Brice André <brice(at)famille-andre(dot)be>
To: Alexey Bashtanov <bashtanov(at)imap(dot)cc>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Problem inserting binary data in bytea column of UTF-8 database
Date: 2018-07-07 06:42:13
Message-ID: CAOBG12mzfRYpec_KSginj5H-z=QTDj0U0m9N3nPp7kp-KjN9cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello Alexey,

You are right!

Double quote disapeared in my C++ program (because not properly escaped)
and I performed copy paste of C++ generated SQL query for further tests
without realising that there was a missing backslash.

Thanks for your help,
Brice

2018-07-05 15:48 GMT+02:00 Alexey Bashtanov <bashtanov(at)imap(dot)cc>:

> Hi Brice,
>
> On 03/07/18 05:28, Brice André wrote:
>
>> insert into test (test) values (E'\xC744'::bytea);
>>
>
> I think double backslash needs to be used.
> See https://www.postgresql.org/docs/current/static/datatype-bina
> ry.html#id-1.5.7.12.9
>
> Best,
> Alex
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message komala pelleti 2018-07-26 10:38:55 Vacumdb Command Problem
Previous Message David G. Johnston 2018-07-05 14:04:38 Re: Problem inserting binary data in bytea column of UTF-8 database