Re: CHAR(N) storage requirement

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CHAR(N) storage requirement
Дата
Msg-id 16714.1073839371@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CHAR(N) storage requirement  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
Peter Eisentraut <peter_e@gmx.net> writes:
> Storing char(n) takes 4 bytes plus as many bytes are are required to
> store the actual string, plus n - length(value) bytes for padding
> spaces.  This is at least "n" bytes.

Peter omitted one critical point that I think David hasn't absorbed
yet: char(N) measures N in characters, not bytes.  When using a
multibyte encoding, N characters may require more than N bytes.
Only in single-byte encodings can you make any simple statements
about the number of bytes occupied by char(N).  This is why the docs
are a bit vague.

            regards, tom lane

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: CHAR(N) storage requirement
Следующее
От: David Garamond
Дата:
Сообщение: Re: CHAR(N) storage requirement