bdr: command filter enhancements and fixes
authorChristian Kruse <cjk@defunct.ch>
Thu, 8 May 2014 12:33:25 +0000 (14:33 +0200)
committerAndres Freund <andres@anarazel.de>
Thu, 3 Jul 2014 15:55:32 +0000 (17:55 +0200)
Forbidding renaming of ALTER AGGREGATE โ€ฆ RENAME TO โ€ฆ, ALTER COLLATION โ€ฆ
RENAME TO โ€ฆ, ALTER CONVERSION โ€ฆ RENAME TO โ€ฆ, ALTER OPERATOR CLASS โ€ฆ
RENAME TO โ€ฆ, ALTER OPERATOR FAMILY โ€ฆ RENAME TO โ€ฆ. Forbidding ALTER
TABLESPACE โ€ฆ MOVE โ€ฆ, too.

contrib/bdr/bdr_commandfilter.c

index 7fc500dffe1d97326d5544927b5cb84d1055c3f2..f0fdd88a35da6152ada16b4f92e8cd5f2d074e95 100644 (file)
@@ -473,8 +473,26 @@ bdr_commandfilter(Node *parsetree,
            break;
 
        case T_DropStmt:
+           break;
+
        case T_RenameStmt:
-           /* FIXME: catch unsupported rename operations */
+           {
+               RenameStmt *n = (RenameStmt *)parsetree;
+
+               switch(n->renameType)
+               {
+               case OBJECT_AGGREGATE:
+               case OBJECT_COLLATION:
+               case OBJECT_CONVERSION:
+               case OBJECT_OPCLASS:
+               case OBJECT_OPFAMILY:
+                   error_unsupported_command(CreateCommandTag(parsetree));
+                   break;
+
+               default:
+                   break;
+               }
+           }
            break;
 
        case T_AlterObjectSchemaStmt:
@@ -482,7 +500,7 @@ bdr_commandfilter(Node *parsetree,
            break;
 
        case T_AlterTableSpaceMoveStmt:
-           /* XXX: forbid? */
+           error_unsupported_command("ALTER TABLESPACE ... MOVE");
            break;
 
        case T_AlterOwnerStmt: