Problem inserting binary data in bytea column of UTF-8 database
От | Brice André |
---|---|
Тема | Problem inserting binary data in bytea column of UTF-8 database |
Дата | |
Msg-id | CAOBG12mH+BnY=YNzgYyRvbb_cAoizsVSPrdFVZujv=AtSPuySw@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Problem inserting binary data in bytea column of UTF-8 database
|
Список | pgsql-sql |
Dear all,
I have a problem when trying to insert binary data in a bytea column of my database. If the binary data contains non-UTF-8 characters, the insert operation is rejected with a "ERROR: invalid byte sequence for encoding "UTF8"" result.CREATE DATABASE test WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';
\connect test;
CREATE TABLE test (test bytea);
insert into test (test) values (E'\xC744'::bytea);
This script generates same error when executed directly on the postgresql server with "psql" command.
В списке pgsql-sql по дате отправления: