Replace pg_escape_literal with pg_escape_string