Read filter xml and execute query in postgres