"Michaud, Everett" <EMichaud(at)sequoianet(dot)com> writes:
> Perhaps this is simple, but it has me stumped. What is the data type to
> use for returning a value from count?
int8, a/k/a bigint. Or if you really want to return int4, you could
cast the count() result to int4.
> ERROR: return type mismatch in function declared to return integer
I don't think any modern version of Postgres is that stingy with
information about this error. I get either
ERROR: return type mismatch in function: declared to return integer, returns bigint
ERROR: return type mismatch in function declared to return integer
DETAIL: Actual return type is bigint.
depending on which version I try.
regards, tom lane
In response to
pgsql-novice by date
|Next:||From: Michael Fuhr||Date: 2004-10-31 06:54:34|
|Subject: Re: help using count in function|
|Previous:||From: Tom Lane||Date: 2004-10-30 16:58:32|
|Subject: Re: Array Question |