Content-Length: 279395 | pFad | http://github.com/postgrespro/postgres/commit/7284dfe42cb40f89a92eee61b260075d0a707938

93 Add sanity check to ensure delimiter and quote are different in CSV mode · postgrespro/postgres@7284dfe · GitHub
Skip to content

Commit 7284dfe

Browse files
committed
Add sanity check to ensure delimiter and quote are different in CSV mode
1 parent a225bf0 commit 7284dfe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/backend/commands/copy.c

Lines changed: 6 additions & 1 deletion
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.293 2007/12/27 18:28:58 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.294 2007/12/30 14:46:52 adunstan Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -906,6 +906,11 @@ DoCopy(const CopyStmt *stmt, const char *queryString)
906906
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
907907
errmsg("COPY quote must be a single ASCII character")));
908908

909+
if (cstate->csv_mode && cstate->delim[0] == cstate->quote[0])
910+
ereport(ERROR,
911+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
912+
errmsg("COPY delimiter and quote must be different")));
913+
909914
/* Check escape */
910915
if (!cstate->csv_mode && cstate->escape != NULL)
911916
ereport(ERROR,

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/7284dfe42cb40f89a92eee61b260075d0a707938

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy