Re: Array access to type "name"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Array access to type "name"
Дата
Msg-id 22716.1051419961@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Array access to type "name"  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Array access to type "name"
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> The type "name" can be subscripted like an array to access the individual
> "char" elements.  But since a character stored in a "name" value isn't
> necessarily one byte, this is incorrect.  Does anything rely on this
> facility, or would it be better to remove it for type "name"?

The fact that it isn't very useful for multibyte character sets doesn't
seem to me to be reason to remove it for everyone ...

> Here's an example that produces a failure:
> $ export PGCLIENTENCODING=latin1
> $ createdb -E UNICODE test
> $ psql test
> => create table �land (a int);
> => create table �berschall (b int);
> => select relname[0] from pg_class;
> ERROR:  Could not convert UTF-8 to ISO8859-1

I'm not having any luck duplicating that here, but in any case what the
above suggests to me is lack of robustness in the output conversion
chain for type "char".  Or do you want to legislate that byte values
corresponding to the first bytes of multibyte character sequences are
illegal values for type "char"?  I'd have a problem with that ...
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: STABLE functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: current breakage with PGCLIENTENCODING