Smallint - Integer Casting Problems in Plpgsql functions

Поиск
Список
Период
Сортировка
От Denis Gasparin
Тема Smallint - Integer Casting Problems in Plpgsql functions
Дата
Msg-id 405874AB.9020701@edistar.com
обсуждение исходный текст
Ответы Re: Smallint - Integer Casting Problems in Plpgsql functions  (Richard Huxton <dev@archonet.com>)
Список 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 по дате отправления:

Предыдущее
От: Paul Thomas
Дата:
Сообщение: Re: Newbie question: OT
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Newbie question: OT