Of course more general solution will be to change the postgresql.conf file with: standard_conforming_strings = on