Fix issue with date filters on custom fields with PostgreSQL

See also PR #122 which adds checking for DB version in admin checks