Re: why do i get 2 as answer for select length('aa '::char(6));
В списке pgsql-novice по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: why do i get 2 as answer for select length('aa '::char(6)); |
| Дата | |
| Msg-id | 14571.1516159925@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: why do i get 2 as answer for select length('aa '::char(6)); (john snow <ofbizfanster@gmail.com>) |
| Ответы |
Re: why do i get 2 as answer for select length('aa '::char(6));
|
| Список | pgsql-novice |
john snow <ofbizfanster@gmail.com> writes:
> when you say char-type values, do you include varchar?
No. varchar and text consider trailing spaces to be significant.
To my mind, there are very few situations where char(n) is actually
a reasonable choice of datatype. Maybe for US state abbreviations
or the like. If you're even asking this question, it suggests that
you ought to be using varchar/text.
char(n) basically exists to support fixed-field-width data designs that
should have died along with the punched cards that inspired them.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера