clean
adapted for psql
for psql