Re: invalid UTF-8 via pl/perl

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: invalid UTF-8 via pl/perl
Дата
Msg-id 7573.1262549711@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: invalid UTF-8 via pl/perl  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: invalid UTF-8 via pl/perl  (Andrew Dunstan <andrew@dunslane.net>)
Re: invalid UTF-8 via pl/perl  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
>     andrew=# select 'a' || invalid_utf_seq() || 'b';
>     ERROR:  invalid byte sequence for encoding "UTF8": 0xd0
>     HINT:  This error can also happen if the byte sequence does not
>     match the encoding expected by the server, which is controlled by
>     "client_encoding".
>     CONTEXT:  PL/Perl function "invalid_utf_seq"

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

Yeah, we want the detailed error info.  The problem is that the hint is
targeted to the case where we are checking data coming from the client.
We could add another parameter to pg_verifymbstr to indicate the
context, perhaps.  I'm not sure how to do it exactly --- just a bool
that suppresses the hint, or do we want to make a provision for some
other hint or detail message?
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: invalid UTF-8 via pl/perl
Следующее
От: Tom Lane
Дата:
Сообщение: Re: invalid UTF-8 via pl/perl