Re: Functions just dont want to work! [hard] - Mailing list pgsql-general

From Andrew J. Kopciuch
Subject Re: Functions just dont want to work! [hard]
Date
Msg-id 200212041325.43622.akopciuch@bddf.ca
Whole thread Raw
In response to Re: Functions just dont want to work! [hard]  (Joel Burton <joel@joelburton.com>)
Responses Re: Functions just dont want to work! [hard]  (Joel Burton <joel@joelburton.com>)
List pgsql-general
> Problem is that 24 is not an int2 -- it's an int4 (generic int type).
> For example:
>

Yes it is ...  int2 is a two byte integer, meaning it has a range from
-32768 to +32767.  Unless I totally mistaken, 24 falls within that range.

Am I missing something vital to this problem?  What you have said seems
incorrect to me.

> joel@joel=# create function hi(int2) returns bool as 'begin return true;
> end;' language 'plpgsql';
> CREATE FUNCTION
> joel@joel=# select hi(42);
> ERROR:  Function hi(integer) does not exist
> Unable to identify a function that satisfies the given argument types
> You may need to add explicit typecasts
>

It works fine for me:

test=# create function hi(int2) returns bool as 'begin return true;
test'# end;' language 'plpgsql';
CREATE
test=# select hi(42);
 hi
----
 t
(1 row)

test=#




What version are you using?

Andy

pgsql-general by date:

Previous
From: Joel Burton
Date:
Subject: Re: Functions just dont want to work! [hard]
Next
From: Joel Burton
Date:
Subject: Re: Functions just dont want to work! [hard]