| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера