diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 7af8200e0637a1591c18df221731c0c190d24780..045b40ec1de8a11494042d32d3981ca6a776e8a7 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.218 2004/02/10 01:55:24 tgl Exp $
+ *	  $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.219 2004/04/06 13:21:33 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -779,6 +779,14 @@ DoCopy(const CopyStmt *stmt)
 				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
 				 errmsg("COPY delimiter must be a single character")));
 
+	/*
+	 * Don't allow the delimiter to appear in the null string.
+	 */
+	if (strchr(null_print, delim[0]) != NULL)
+		ereport(ERROR,
+				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+				 errmsg("COPY delimiter must not appear in the NULL specification")));
+
 	/*
 	 * Don't allow COPY w/ OIDs to or from a table without them
 	 */