Fix filter pluck query for PostgreSQL

For #2324