Re: Problem inserting binary data in bytea column of UTF-8 database - Mailing list pgsql-sql

From Brice André
Subject Re: Problem inserting binary data in bytea column of UTF-8 database
Date
Msg-id CAOBG12mzfRYpec_KSginj5H-z=QTDj0U0m9N3nPp7kp-KjN9cg@mail.gmail.com
Whole thread Raw
In response to Re: Problem inserting binary data in bytea column of UTF-8 database  (Alexey Bashtanov <bashtanov@imap.cc>)
List 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@imap.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-binary.html#id-1.5.7.12.9

Best,
  Alex

pgsql-sql by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Problem inserting binary data in bytea column of UTF-8 database
Next
From: komala pelleti
Date:
Subject: Vacumdb Command Problem