77 *
88 *
99 * IDENTIFICATION
10- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.143 2001/12/04 19:40:16 tgl Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.144 2001/12/0421: 19:57 tgl Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -288,6 +288,12 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
288288if (pipe && binary )
289289elog (ERROR ,"COPY BINARY is not supported to stdout or from stdin" );
290290
291+ /*
292+ * Presently, only single-character delimiter strings are supported.
293+ */
294+ if (strlen (delim )!= 1 )
295+ elog (ERROR ,"COPY delimiter must be a single character" );
296+
291297/*
292298 * Set up variables to avoid per-attribute overhead.
293299 */
@@ -1009,7 +1015,7 @@ CopyReadNewline(FILE *fp, int *newline)
10091015 * Note that the caller should not pfree the string!
10101016 *
10111017 * *isnull is set true if a null attribute, else false.
1012- * delim is the stringof acceptable delimiter characters(s ).
1018+ * delim is thecolumn delimiter string(currently always 1 character ).
10131019 * *newline remembers whether we've seen a newline ending this tuple.
10141020 * null_print says how NULL values are represented
10151021 */
@@ -1018,6 +1024,7 @@ static char *
10181024CopyReadAttribute (FILE * fp ,bool * isnull ,char * delim ,int * newline ,char * null_print )
10191025{
10201026int c ;
1027+ int delimc = delim [0 ];
10211028
10221029#ifdef MULTIBYTE
10231030int mblen ;
@@ -1051,7 +1058,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline, char *null_
10511058* newline = 1 ;
10521059break ;
10531060}
1054- if (strchr ( delim , c ) )
1061+ if (c == delimc )
10551062break ;
10561063if (c == '\\' )
10571064{