Skip to content

Commit 52e4f27

Browse files
committed
Prevent doubling of escapes when not in quote mode for CSV.
1 parent 1ad5905 commit 52e4f27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/commands/copy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.221 2004/04/19 17:22:30 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.222 2004/04/19 21:58:02 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2599,7 +2599,7 @@ CopyAttributeOutCSV(char *server_string, char *delim, char *quote,
25992599

26002600
for (; (c = *string) != '\0'; string += mblen)
26012601
{
2602-
if (c == quotec || c == escapec)
2602+
if (need_quote && (c == quotec || c == escapec))
26032603
CopySendChar(escapec);
26042604

26052605
CopySendChar(c);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy