From c0b703e2ce26406a725fbdb52403d35a73da966f Mon Sep 17 00:00:00 2001 From: Christian Kruse Date: Thu, 8 May 2014 14:33:25 +0200 Subject: [PATCH] bdr: command filter enhancements and fixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/contrib/bdr/bdr_commandfilter.c b/contrib/bdr/bdr_commandfilter.c index 7fc500dffe..f0fdd88a35 100644 --- a/contrib/bdr/bdr_commandfilter.c +++ b/contrib/bdr/bdr_commandfilter.c @@ -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: -- 2.39.5