"Michaud, Everett" <EMichaud@sequoianet.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
or
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