pg_escape_string
returns its argument with added
characters which makes it safe for use in single-quoted SQL string
constants. That is, it returns the string with all single quote marks
and backslash characters doubled.
For example, pg_escape_string {a'b\c} returns the string a''b\\c.
See also pg_quote.
This command uses or emulates the PostgreSQL
libpq
function PQescapeString
.