!1099 添加一些shutdown命令的禁止权限
Merge pull request !1099 from gentle_hu/shutdown
This commit is contained in:
@ -1077,7 +1077,7 @@ stmt :
|
||||
| RuleStmt
|
||||
| SecLabelStmt
|
||||
| SelectStmt
|
||||
| ShutdownStmt
|
||||
| ShutdownStmt
|
||||
| TransactionStmt
|
||||
| TruncateStmt
|
||||
| UnlistenStmt
|
||||
|
@ -29,6 +29,10 @@
|
||||
|
||||
void DoShutdown(ShutdownStmt* stmt)
|
||||
{
|
||||
#ifdef ENABLE_MULTIPLE_NODES
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("SHUTDOWN is not supported in distributed mode.")));
|
||||
#endif
|
||||
|
||||
if (!superuser()) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("Only system admin can shutdown database."))));
|
||||
|
Reference in New Issue
Block a user