PostgreSQL isField fix

Fixes a issue, that the current implementation of isField does not work for postgres (tested against redmine 2.3, the relations are wrong)