Smallint - Integer Casting Problems in Plpgsql functions

From: Denis Gasparin <denis(at)edistar(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Smallint - Integer Casting Problems in Plpgsql functions
Date: 2004-03-17 15:54:19
Message-ID: 405874AB.9020701@edistar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, i'm upgrading our database from postgresql 7.2.3 to 7.4.2.
The import went fine but i have some casting problems with plpgsql
functions.

I've create a test function with this code:

create function test(varchar,smallint,integer) returns integer as '
declare
a alias for $1;
b alias for $2;
c alias for $3;
begin
raise notice ''test'';
return 1;
end;
' language 'plpgsql';

The command:
select test('aaa',1,1);
gives me the following error:
ERROR: function test("unknown", integer, integer) does not exist
HINT: No function matches the given name and argument types. You may
need to add explicit type casts.

Obviously, with the command:
select test('aaa',1::smallint,1);

the result is 1.

Thank you in advance for your help,

--
Doct. Eng. Denis Gasparin: denis(at)edistar(dot)com
---------------------------
Programmer & System Administrator - Edistar srl

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-03-17 16:07:42 Re: Newbie question: OT
Previous Message Paul Thomas 2004-03-17 15:51:32 Re: Newbie question: OT