diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/commands/copyto.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/commands/copyto.c b/src/backend/commands/copyto.c index a9f422b71ce..99d65beac6b 100644 --- a/src/backend/commands/copyto.c +++ b/src/backend/commands/copyto.c @@ -466,7 +466,7 @@ BeginCopyTo(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, @@ -483,7 +483,11 @@ BeginCopyTo(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 |