Re: When is an explicit cast necessary?

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: A B
Дата:
Сообщение: Re: Need some help with a query (uniq -c)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: psql's \d display of unique index vs. constraint