deparse/core: event triggers support GRANT/REVOKE
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 9 May 2014 22:32:23 +0000 (18:32 -0400)
committerAndres Freund <andres@anarazel.de>
Fri, 5 Sep 2014 20:09:11 +0000 (22:09 +0200)
src/backend/commands/event_trigger.c
src/backend/tcop/utility.c

index 96f926cbb2a7fc24540affb290f90fcbea3fc72e..d82697cd73ae0b15fe5b056d3a5e97fc07e0a375 100644 (file)
@@ -250,6 +250,8 @@ check_ddl_tag(const char *tag)
        pg_strcasecmp(tag, "REFRESH MATERIALIZED VIEW") == 0 ||
        pg_strcasecmp(tag, "ALTER DEFAULT PRIVILEGES") == 0 ||
        pg_strcasecmp(tag, "ALTER LARGE OBJECT") == 0 ||
+       pg_strcasecmp(tag, "GRANT") == 0 ||
+       pg_strcasecmp(tag, "REVOKE") == 0 ||
        pg_strcasecmp(tag, "DROP OWNED") == 0)
        return EVENT_TRIGGER_COMMAND_TAG_OK;
 
index 18c74525fa02fc940d6529df5adaa59573545728..606d3bdf39d36dc5b1f21d221b191529f75a5c16 100644 (file)
@@ -549,11 +549,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);
@@ -1307,6 +1302,11 @@ ProcessUtilitySlow(Node *parsetree,
                ExecAlterOwnerStmt((AlterOwnerStmt *) parsetree);
                break;
 
+           case T_GrantStmt:
+               /* command is stashed in ExecuteGrantStmt_oids */
+               ExecuteGrantStmt((GrantStmt *) parsetree);
+               break;
+
            case T_DropOwnedStmt:
                DropOwnedObjects((DropOwnedStmt *) parsetree);
                break;