Smallint - Integer Casting Problems in Plpgsql functions - Mailing list pgsql-general

From Denis Gasparin
Subject Smallint - Integer Casting Problems in Plpgsql functions
Date
Msg-id 405874AB.9020701@edistar.com
Whole thread Raw
Responses Re: Smallint - Integer Casting Problems in Plpgsql functions
List 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@edistar.com
---------------------------
Programmer & System Administrator - Edistar srl


pgsql-general by date:

Previous
From: Paul Thomas
Date:
Subject: Re: Newbie question: OT
Next
From: Tom Lane
Date:
Subject: Re: Newbie question: OT