| От | Tom Lane |
|---|---|
| Тема | Re: When is an explicit cast necessary? |
| Дата | |
| Msg-id | 8479.1271186166@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: When is an explicit cast necessary? (Martijn van Oosterhout <kleptog@svana.org>) |
| Список | pgsql-general |
Martijn van Oosterhout <kleptog@svana.org> writes:
> The question is: does the column really need to be smallint.
Yeah. Usually, declaring a function's argument as int rather than
smallint is the easiest fix. We have looked into this in the past,
and concluded that the negative aspects of allowing integer constants
to implicitly cast to smallint parameters would outweigh the
positives. As an example, such simple expressions as "2 + 2" would
start to fail because it'd be unclear whether int or smallint addition
is meant. (And the point isn't academic, since for example it would
affect the overflow threshold.)
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера