diff options
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 64 |
1 files changed, 51 insertions, 13 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 3533cfa22d4..fcc2ecdbfb4 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -513,14 +513,6 @@ standard_ProcessUtility(Node *parsetree, ExecuteTruncate((TruncateStmt *) parsetree); break; - case T_CommentStmt: - CommentObject((CommentStmt *) parsetree); - break; - - case T_SecLabelStmt: - ExecSecLabelStmt((SecLabelStmt *) parsetree); - break; - case T_CopyStmt: { uint64 processed; @@ -548,11 +540,6 @@ standard_ProcessUtility(Node *parsetree, DeallocateQuery((DeallocateStmt *) parsetree); break; - case T_GrantStmt: - /* no event triggers for global objects */ - ExecuteGrantStmt((GrantStmt *) parsetree); - break; - case T_GrantRoleStmt: /* no event triggers for global objects */ GrantRole((GrantRoleStmt *) parsetree); @@ -783,6 +770,19 @@ standard_ProcessUtility(Node *parsetree, * in some cases, so we "fast path" them in the other cases. */ + case T_GrantStmt: + { + GrantStmt *stmt = (GrantStmt *) parsetree; + + if (EventTriggerSupportsGrantObjectType(stmt->objtype)) + ProcessUtilitySlow(parsetree, queryString, + context, params, + dest, completionTag); + else + ExecuteGrantStmt((GrantStmt *) parsetree); + } + break; + case T_DropStmt: { DropStmt *stmt = (DropStmt *) parsetree; @@ -835,6 +835,32 @@ standard_ProcessUtility(Node *parsetree, } break; + case T_CommentStmt: + { + CommentStmt *stmt = (CommentStmt *) parsetree; + + if (EventTriggerSupportsObjectType(stmt->objtype)) + ProcessUtilitySlow(parsetree, queryString, + context, params, + dest, completionTag); + else + CommentObject((CommentStmt *) parsetree); + break; + } + + case T_SecLabelStmt: + { + SecLabelStmt *stmt = (SecLabelStmt *) parsetree; + + if (EventTriggerSupportsObjectType(stmt->objtype)) + ProcessUtilitySlow(parsetree, queryString, + context, params, + dest, completionTag); + else + ExecSecLabelStmt(stmt); + break; + } + default: /* All other statement types have event trigger support */ ProcessUtilitySlow(parsetree, queryString, @@ -1315,6 +1341,14 @@ ProcessUtilitySlow(Node *parsetree, ExecAlterOwnerStmt((AlterOwnerStmt *) parsetree); break; + case T_CommentStmt: + CommentObject((CommentStmt *) parsetree, NULL); + break; + + case T_GrantStmt: + ExecuteGrantStmt((GrantStmt *) parsetree); + break; + case T_DropOwnedStmt: DropOwnedObjects((DropOwnedStmt *) parsetree); break; @@ -1331,6 +1365,10 @@ ProcessUtilitySlow(Node *parsetree, AlterPolicy((AlterPolicyStmt *) parsetree); break; + case T_SecLabelStmt: + ExecSecLabelStmt((SecLabelStmt *) parsetree; + break; + default: elog(ERROR, "unrecognized node type: %d", (int) nodeTag(parsetree)); |