char(30)
is typically not useful as has been commented. See:
But that's not the problem.
A different role or missing privileges could also not be the problem, that would produce a different error message.
Your call:
select bcount('Deccan');
... with an untyped string constant as parameter would be coerced to the type, as long as any function of that name is found in the search_path
.
Speaking of which, what was the search_path
in your pgAdmin environment? Put differently, what's the schema your function was created in? Check with:
SELECT pronamespace::regnamespace AS schema, proname
, pg_get_functiondef(oid)
FROM pg_proc
WHERE proname = 'bcount';
And what's the search_path
in your psql environment? Is the schema of the function contained?
SHOW search_path;
See:
It's either that, or you connected to the wrong database. A Postgres database cluster consists of any number of databases. If you don't connect to a particular one, you may end up in the default maintenance database named "postgres". In psql, switch with:
\c my_database
Or you connected to the wrong db cluster altogether.