Re: Bug #728: Interactions between bytea and character encoding

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Bug #728: Interactions between bytea and character encoding
Дата
Msg-id 3D4CBB04.4090906@joeconway.com
обсуждение исходный текст
Ответ на Bug #728: Interactions between bytea and character encoding when doing analyze  (pgsql-bugs@postgresql.org)
Ответы Re: Bug #728: Interactions between bytea and character encoding  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
Tom Lane wrote:
> Ah.  So the issue is that ANALYZE tries to do textin(byteaout(...))
> in order to produce a textual representation of the most common value
> in the BYTEA column, and apparently textin feels that the string
> generated by byteaout is not legal text.  While Joe says that the
> problem has gone away in CVS tip, I'm not sure I believe that.

I didn't either, except I tried it and it worked ;-) But you're
undoubtedly correct that there are other cases which would break the
current code.


> A possible answer is to change the pg_statistics columns from text to
> some other less picky datatype.  (bytea maybe ;-))  Or should we
> conclude that text is broken and needs to be fixed?  Choice #3 would
> be "bytea is broken and needs to be fixed", but I don't care for that
> answer --- if bytea can produce an output string that will break
> pg_statistics, then so can some other future datatype.

BYTEA sounds like the best answer to me. TEXT is supposed to honor
character set specific peculiarities, while bytea should be able to
represent any arbitrary set of bytes.

Joe

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: "analyze" putting wrong reltuples in pg_class
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Bug #728: Interactions between bytea and character encoding