Cleaning queries for postgre

Signed-off-by: emanuele <emanuele45@gmail.com>