mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Fix up pg_dump to do string escaping fully correctly for client encoding
and standard_conforming_strings; likewise for the other client programs that need it. As per previous discussion, a pg_dump dump now conforms to the standard_conforming_strings setting of the source database. We don't use E'' syntax in the dump, thereby improving portability of the SQL. I added a SET escape_strings_warning = off command to keep the dumps from getting a lot of back-chatter from that.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.185 2006/05/28 17:23:29 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.186 2006/05/28 21:13:54 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -2437,8 +2437,7 @@ PQescapeStringInternal(PGconn *conn,
|
||||
if (!IS_HIGHBIT_SET(c))
|
||||
{
|
||||
/* Apply quoting if needed */
|
||||
if (c == '\'' ||
|
||||
(c == '\\' && !std_strings))
|
||||
if (SQL_STR_DOUBLE(c, !std_strings))
|
||||
*target++ = c;
|
||||
/* Copy the character */
|
||||
*target++ = c;
|
||||
|
Reference in New Issue
Block a user