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