Don't allow ALTER MATERIALIZED VIEW ADD UNIQUE.
authorKevin Grittner
Thu, 15 Aug 2013 18:16:45 +0000 (13:16 -0500)
committerKevin Grittner
Thu, 15 Aug 2013 18:16:45 +0000 (13:16 -0500)
Was accidentally allowed, but not documented and lacked support
for rename or drop once created.

Per report from Noah Misch.

src/backend/commands/tablecmds.c

index 07c0816abbfa6a0480525158afc0b6fbcba3dba8..6631be8eeb40887068be3750dc7743f14fa5bd1c 100644 (file)
@@ -3031,7 +3031,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
            pass = AT_PASS_DROP;
            break;
        case AT_AddIndex:       /* ADD INDEX */
-           ATSimplePermissions(rel, ATT_TABLE | ATT_MATVIEW);
+           ATSimplePermissions(rel, ATT_TABLE);
            /* This command never recurses */
            /* No command-specific prep needed */
            pass = AT_PASS_ADD_INDEX;