提交 055eba59 编写于 作者: B Bhuvnesh Chaudhary 提交者: Bhuvnesh

Applied Feedback

上级 aa310911
......@@ -990,15 +990,13 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
rel = heap_openrv(stmt->relation,
(is_from ? RowExclusiveLock : AccessShareLock));
if (is_from)
if (is_from && !allowSystemTableMods && IsUnderPostmaster && IsSystemRelation(rel))
{
if (!allowSystemTableMods && IsUnderPostmaster && IsSystemRelation(rel))
{
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("permission denied: \"%s\" is a system catalog",
RelationGetRelationName(rel))));
}
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("permission denied: \"%s\" is a system catalog",
RelationGetRelationName(rel)),
errhint("Make sure the configuration parameter allow_system_table_mods is set.")));
}
relid = RelationGetRelid(rel);
......
......@@ -1615,6 +1615,7 @@ RESET allow_system_table_mods;
-- cannot copy to a catalog table with allow_system_table_mods=off;
COPY gp_configuration_history from stdin with delimiter '|';
ERROR: permission denied: "gp_configuration_history" is a system catalog
HINT: Make sure the configuration parameter allow_system_table_mods is set.
ABORT;
-- GPDB makes the database name, and many other things, available
-- as environment variables to the program. Test those.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册