Thread: Bug on parameter bigint in PL/PGSQL

Bug on parameter bigint in PL/PGSQL

From
Michele Bendazzoli
Date:
I think i found a bug in PL/PGSQL: when i use a parameter bigint (int8)
and call the function from psql an error message which says that "the
functioname(bigint) doesn't exist" is displayed. 
If i turn the int8 to int4 all works fine ...

Now i use two int4 instead of one int8: is advisable?

ciao, Michele





Re: Bug on parameter bigint in PL/PGSQL

From
Stephan Szabo
Date:
On Fri, 22 Aug 2003, Michele Bendazzoli wrote:

> I think i found a bug in PL/PGSQL: when i use a parameter bigint (int8)
> and call the function from psql an error message which says that "the
> functioname(bigint) doesn't exist" is displayed.
> If i turn the int8 to int4 all works fine ...

I can't reproduce from the information above.  Integer constants are
treated as int4, but it should be able to cast that to bigint.  What is
the function you are using to test and what version?



Re: Bug on parameter bigint in PL/PGSQL

From
Richard Huxton
Date:
On Friday 22 August 2003 12:59, Michele Bendazzoli wrote:
> I think i found a bug in PL/PGSQL: when i use a parameter bigint (int8)
> and call the function from psql an error message which says that "the
> functioname(bigint) doesn't exist" is displayed.
> If i turn the int8 to int4 all works fine ...

Seems ok here:

CREATE FUNCTION my_bigint_test(int8) RETURNS int8 AS '
BEGIN RETURN $1 + 1::int8;
END;
' LANGUAGE 'plpgsql';

SELECT my_bigint_test(1);

CREATE FUNCTIONmy_bigint_test
----------------             2
(1 row)

SELECT my_bigint_test(2::int8);my_bigint_test
----------------             3
(1 row)

Can you provide an actual example?

--  Richard Huxton Archonet Ltd


Re: Bug on parameter bigint in PL/PGSQL

From
Michele Bendazzoli
Date:
On Fri, 2003-08-22 at 15:05, Richard Huxton wrote:
> On Friday 22 August 2003 12:59, Michele Bendazzoli wrote:
> > I think i found a bug in PL/PGSQL: when i use a parameter bigint (int8)
> > and call the function from psql an error message which says that "the
> > functioname(bigint) doesn't exist" is displayed.
> > If i turn the int8 to int4 all works fine ...
> 
> Seems ok here:

cut

> Can you provide an actual example?

I delete the example because i don't need it anymore (it was a function
that simply get a int8 and return the last 4 byte (a int4), but now i
don't use int8 anymore) and the one I try to reproduce now just works
fine ...

Maybe it was only my mistake due to the overload capacity of PL/PGSQL: i
wonder if I was testing the errate version of the function while i was
modifying another: the power of postgresql :-)

Thank anyway.

ciao, Michele