Use appropriate postresql quote function.