Fix some queries which doesn't work with postgreSQL