Re: passing strings to functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: passing strings to functions
Дата
Msg-id 14799.1084190180@sss.pgh.pa.us
обсуждение исходный текст
Ответ на passing strings to functions  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-general
Ivan Sergio Borgonovo <mail@webthatworks.it> writes:
> I can't understand how to pass strings to functions.

Your problem isn't with the strings, it's with the smallint parameter.
The undecorated "1" is an integer not a smallint, and it won't be
silently cast in this particular scenario.

> Is there a simpler way than casting everytime?

I'd suggest declaring the function to take integer.  If you really want
the rowtype to use smallint then you can cast internally.

            regards, tom lane

В списке pgsql-general по дате отправления: