Re: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61

Поиск
Список
Период
Сортировка
От Feike Steenbergen
Тема Re: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61
Дата
Msg-id CAK_s-G2nVwyewe1_ucGbLXQUoA9egCqFuS4NjOxEy-e4dc5uMQ@mail.gmail.com
обсуждение исходный текст
Ответ на [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61  (ROS Didier <didier.ros@edf.fr>)
Список pgsql-sql


On 10 October 2017 at 15:28, ROS Didier <didier.ros@edf.fr> wrote:
>     -- Securisation du search_path: les schémas de confiance, puis 
> The error message is :
>
> ERROR:  invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61

I'm guessing your client is actually using an encoding of something like LATIN1, but is identifying itself as UTF8.

The sequence 0xe9 0x6d 0x61 in LATIN1 is "éma", which matches your line with 'les schémas'.
However, 0xe9 is invalid in UTF8.

To validate this, you could do the following:

select current_setting('client_encoding');
set client_encoding to 'LATIN1';
select current_setting('client_encoding');

before executing your command.


By the way, did you know you can set configuration parameters per function on a different way as well:

CREATE OR REPLACE FUNCTION abc()
RETURNS boolean
LANGUAGE SQL AS $$
SELECT true;
$$
SET search_path TO 'public, pg_temp';

В списке pgsql-sql по дате отправления:

Предыдущее
От: ROS Didier
Дата:
Сообщение: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d 0x61
Следующее
От: ROS Didier
Дата:
Сообщение: Re: [SQL] ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x6d0x61 - fixed