Cast columns only for PostgreSQL when filtering.