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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Alexey Bashtanov <bashtanov(at)imap(dot)cc>
Cc: Brice André <brice(at)famille-andre(dot)be>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Problem inserting binary data in bytea column of UTF-8 database
Date: 2018-07-05 14:04:38
Message-ID: CAKFQuwaxRJdPMPENn9pK9nxGKpod_+cnXgqLP0Oa=OuBpPzS1A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thursday, July 5, 2018, Alexey Bashtanov <bashtanov(at)imap(dot)cc> wrote:

> 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
>

Or lose the "E" marker to turn the escape string literal into an ordinary
string literal.

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Brice André 2018-07-07 06:42:13 Re: Problem inserting binary data in bytea column of UTF-8 database
Previous Message Alexey Bashtanov 2018-07-05 13:48:59 Re: Problem inserting binary data in bytea column of UTF-8 database