disable SHUTDOWN in distributed mode

This commit is contained in:
gentle_hu
2021-07-14 10:28:11 +08:00
parent 468d6bcbc2
commit f1abcfcafd
2 changed files with 5 additions and 1 deletions

View File

@ -1077,7 +1077,7 @@ stmt :
| RuleStmt
| SecLabelStmt
| SelectStmt
| ShutdownStmt
| ShutdownStmt
| TransactionStmt
| TruncateStmt
| UnlistenStmt

View File

@ -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."))));