diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index f75e1d700d..df7a4a21c9 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -392,7 +392,7 @@ defGetCopyHeaderChoice(DefElem *def, bool is_from) static CopyOnErrorChoice defGetCopyOnErrorChoice(DefElem *def, ParseState *pstate, bool is_from) { - char *sval; + char *sval = defGetString(def); if (!is_from) ereport(ERROR, @@ -400,16 +400,9 @@ defGetCopyOnErrorChoice(DefElem *def, ParseState *pstate, bool is_from) errmsg("COPY ON_ERROR cannot be used with COPY TO"), parser_errposition(pstate, def->location))); - /* - * If no parameter value given, assume the default value. - */ - if (def->arg == NULL) - return COPY_ON_ERROR_STOP; - /* * Allow "stop", or "ignore" values. */ - sval = defGetString(def); if (pg_strcasecmp(sval, "stop") == 0) return COPY_ON_ERROR_STOP; if (pg_strcasecmp(sval, "ignore") == 0)