Re: Difference in text/char data matching between 7.3.4 & 7.4.2
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Difference in text/char data matching between 7.3.4 & 7.4.2 |
| Дата | |
| Msg-id | 2911.1089434956@sss.pgh.pa.us обсуждение |
| Ответ на | Difference in text/char data matching between 7.3.4 & 7.4.2 (Kazuya Togashi <togashi@sra.co.jp>) |
| Ответы |
Re: Difference in text/char data matching between 7.3.4
|
| Список | pgsql-general |
Kazuya Togashi <togashi@sra.co.jp> writes:
> With version 7.3.4, following query returns true, but with version 7.4.2
> it returns false.
> select ' '::text = ' '::char;
Offhand that seems like a step forward to me. "char" type considers
trailing spaces to be insignificant, so it is really correct to consider
that ' '::char is equivalent to ''::text, not ' '::text which represents
a single significant space.
If you do not like this behavior, I suggest casting your text input to
char so that the comparison will occur under char rules not text rules.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера