deepthi@granwill.com wrote:
> I have tried using the int8 also, even then i am having the problem.
Please CC the list.
The following works for me. I suspect your equivalent of "i" is an int4.
CREATE OR REPLACE FUNCTION test_int8(text) RETURNS int8 AS '
DECLARE
i int8;
tot int8;
BEGIN
i := CAST($1 AS int8);
tot := (i * 256 * 256 * 256) + (i * 256 * 256) + (i * 256) + i;
RETURN tot;
END;
' LANGUAGE plpgsql;
SELECT test_int8('255');
--
Richard Huxton
Archonet Ltd