Escape single quotes for postgres the right way