Fix PostgreSQL warnings about escaped strings

fixes #5577