diff options
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index cd2446f8acb..dd2ffba0eae 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -1547,7 +1547,7 @@ BeginCopy(ParseState *pstate, if (q->querySource == QSRC_NON_INSTEAD_RULE) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("DO ALSO rules are not supported for the COPY"))); + errmsg("DO ALSO rules are not supported for COPY"))); } ereport(ERROR, @@ -1564,7 +1564,11 @@ BeginCopy(ParseState *pstate, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("COPY (SELECT INTO) is not supported"))); - Assert(query->utilityStmt == NULL); + /* The only other utility command we could see is NOTIFY */ + if (query->utilityStmt != NULL) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("COPY query must not be a utility command"))); /* * Similarly the grammar doesn't enforce the presence of a RETURNING |