Postgres – Filter on existing documents