Tilman Rassy <rassy(at)math(dot)TU-Berlin(dot)DE> writes:
> I have the following problem: A certain query, i.e.,
> ...
> when I issue it in psql. When I use the same query from JDBC in Java, the
> column "grade" is SQL NULL.
It's hard to believe it's really the "same" query in both cases. Maybe
you're using parameters in the JDBC case and they're not quite right?
Maybe the Java user has a different search_path or something?
regards, tom lane