From: Bruce Momjian Date: Mon, 19 Apr 2004 21:58:02 +0000 (+0000) Subject: Prevent doubling of escapes when not in quote mode for CSV. X-Git-Tag: REL8_0_0BETA1~812 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52e4f27af9b37f61bfc5c301fea4a263600ca1cf;p=postgresql Prevent doubling of escapes when not in quote mode for CSV. --- diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index abb153616a..b532c158bc 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.221 2004/04/19 17:22:30 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.222 2004/04/19 21:58:02 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2599,7 +2599,7 @@ CopyAttributeOutCSV(char *server_string, char *delim, char *quote, for (; (c = *string) != '\0'; string += mblen) { - if (c == quotec || c == escapec) + if (need_quote && (c == quotec || c == escapec)) CopySendChar(escapec); CopySendChar(c);