Add quote() on some queries to make correctly working on postgreSQL