| От | Tom Lane |
|---|---|
| Тема | Re: [HACKERS] char_length()? |
| Дата | |
| Msg-id | 4741.948600977@sss.pgh.pa.us обсуждение |
| Ответ на | char_length()? (Tatsuo Ishii <t-ishii@sra.co.jp>) |
| Ответы |
Re: [HACKERS] char_length()?
|
| Список | pgsql-hackers |
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> char_length()/octet_length() for char() datatype returns a character
> length *except* the trailing blanks. Is this what the standard
> expects? Oracle's length() returns 3 in the case below.
AFAICT Oracle is right --- the spec just says
i) If the data type of S is a character data type, then the result is the number of
charactersin the value of S.
and I can't see anything there about stripping pad characters. You
could ask for length(trim(S)) if you don't want to count blanks.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера