| От | Tom Lane |
|---|---|
| Тема | Re: chr(3) and 3::text |
| Дата | |
| Msg-id | 5568.1585411346@sss.pgh.pa.us обсуждение |
| Ответ на | Re: chr(3) and 3::text ("David G. Johnston" <david.g.johnston@gmail.com>) |
| Список | pgsql-novice |
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Sat, Mar 28, 2020 at 8:09 AM gmail Vladimir Koković <
> vladimir.kokovic@gmail.com> wrote:
>> Main question is, why is 3::text == '3' ?
> Its that way because :: is defined to make it that way.
More concretely: for most types, casting to text is defined to produce the
textual representation of the value. An unadorned literal 3 starts life
as type integer, so what you've got here is an integer-to-text cast,
and that's going to convert the integer the same way it would be output.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера