deparse: Check if security label is on a event trigger supported object.
authorAndres Freund <andres@anarazel.de>
Sat, 17 Jan 2015 22:21:50 +0000 (23:21 +0100)
committerAndres Freund <andres@anarazel.de>
Sat, 17 Jan 2015 22:21:50 +0000 (23:21 +0100)
Otherwise there'll be errors during deparsing.

src/backend/tcop/utility.c

index 983d3f9a26d73083fa2b2d21e3df25f03883d7ef..0aaa0d6652497f434a4b2099bca71872e508a5b3 100644 (file)
@@ -831,6 +831,19 @@ standard_ProcessUtility(Node *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,