Re: invalid UTF-8 via pl/perl

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: invalid UTF-8 via pl/perl
Дата
Msg-id 4B40F60D.5050200@dunslane.net
обсуждение исходный текст
Ответ на Re: invalid UTF-8 via pl/perl  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: invalid UTF-8 via pl/perl  ("David E. Wheeler" <david@kineticode.com>)
Re: invalid UTF-8 via pl/perl  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: invalid UTF-8 via pl/perl  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

I wrote:
>
> I think the attached patch plugs the direct SPI holes as well.

There are two issues with this patch. First, how far if at all should it 
be backpatched? All the way, or 8.3, where we tightened the encoding 
rules, or not at all?

Second, It produces errors like this:
   andrew=# select 'a' || invalid_utf_seq() || 'b';   ERROR:  invalid byte sequence for encoding "UTF8": 0xd0   HINT:
Thiserror can also happen if the byte sequence does not   match the encoding expected by the server, which is
controlledby   "client_encoding".   CONTEXT:  PL/Perl function "invalid_utf_seq"   andrew=#
 


That hint seems rather misleading. I'm not sure what we can do about it 
though. If we set the noError param on pg_verifymbstr() we would miss 
the error message that actually identified the bad data, so that doesn't 
seem like a good plan.

cheers

andrew



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: PATCH: Add hstore_to_json()
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: PATCH: Add hstore_to_json()