bdr.table_set_replication_sets should permit unsafe commands
authorCraig Ringer <craig@2ndquadrant.com>
Fri, 15 May 2015 09:08:52 +0000 (17:08 +0800)
committerCraig Ringer <craig@2ndquadrant.com>
Fri, 22 May 2015 04:42:06 +0000 (12:42 +0800)
In 4005c1d bdr_replicate_ddl_command was changed not to override the
command filter, but this broke replication sets in UDR, since they have
to use SECURITY LABEL.

SET bdr.permit_unsafe_ddl_commands on bdr.table_set_replication_sets
since it knows what it's doing.

Fixes #67

Note: The ddl/replication_sets tests cannot be run as-is on UDR because
UDR does not replicate changes to replication sets. We really need
separate tests for this that cover UDR (or BDR+subscribe).

bdr.control
expected/upgrade.out
extsql/bdr--0.10.0.1--0.10.0.2.sql [new file with mode: 0644]
sql/upgrade.sql

index b992fe03df9c27f3bccc2fd1c9d940a9bd4aed8b..670bd020f098a73f588001395946e1ffba23b2f8 100644 (file)
@@ -1,6 +1,6 @@
 # bdr extension
 comment = 'Bi-directional replication for PostgreSQL'
-default_version = '0.10.0.1'
+default_version = '0.10.0.2'
 module_pathname = '$libdir/bdr'
 relocatable = false
 requires = btree_gist
index a47770ebfd5c75c56e4d38d42def34ae8b4a70ed..45515214643a4c62493cd17055b0101c1e78356b 100644 (file)
@@ -37,6 +37,8 @@ CREATE EXTENSION bdr VERSION '0.10.0.0';
 DROP EXTENSION bdr;
 CREATE EXTENSION bdr VERSION '0.10.0.1';
 DROP EXTENSION bdr;
+CREATE EXTENSION bdr VERSION '0.10.0.2';
+DROP EXTENSION bdr;
 -- evolve version one by one from the oldest to the newest one
 CREATE EXTENSION bdr VERSION '0.8.0';
 ALTER EXTENSION bdr UPDATE TO '0.8.0.1';
@@ -53,14 +55,15 @@ ALTER EXTENSION bdr UPDATE TO '0.9.0.3';
 ALTER EXTENSION bdr UPDATE TO '0.9.0.4';
 ALTER EXTENSION bdr UPDATE TO '0.10.0.0';
 ALTER EXTENSION bdr UPDATE TO '0.10.0.1';
+ALTER EXTENSION bdr UPDATE TO '0.10.0.2';
 -- Should never have to do anything: You missed adding the new version above.
 ALTER EXTENSION bdr UPDATE;
-NOTICE:  version "0.10.0.1" of extension "bdr" is already installed
+NOTICE:  version "0.10.0.2" of extension "bdr" is already installed
 \dx bdr
                        List of installed extensions
  Name | Version  |   Schema   |                Description                
 ------+----------+------------+-------------------------------------------
- bdr  | 0.10.0.1 | pg_catalog | Bi-directional replication for PostgreSQL
+ bdr  | 0.10.0.2 | pg_catalog | Bi-directional replication for PostgreSQL
 (1 row)
 
 \c postgres
diff --git a/extsql/bdr--0.10.0.1--0.10.0.2.sql b/extsql/bdr--0.10.0.1--0.10.0.2.sql
new file mode 100644 (file)
index 0000000..9d32af7
--- /dev/null
@@ -0,0 +1,15 @@
+SET LOCAL search_path = bdr;
+SET bdr.permit_unsafe_ddl_commands = true;
+SET bdr.skip_ddl_replication = true;
+
+--
+-- set_replication_sets knows what it's doing and needs to be able to
+-- replicate SECURITY LABEL commands
+--
+ALTER FUNCTION bdr.table_set_replication_sets(p_relation regclass, p_sets text[])
+SET bdr.permit_unsafe_ddl_commands = true;
+
+
+RESET bdr.permit_unsafe_ddl_commands;
+RESET bdr.skip_ddl_replication;
+RESET search_path;
index d00672eed63674d6cc47ca01abe591dc04c5e35e..fed7e2bebdcd992cfe5febe87589f747b21f34d0 100644 (file)
@@ -54,6 +54,9 @@ DROP EXTENSION bdr;
 CREATE EXTENSION bdr VERSION '0.10.0.1';
 DROP EXTENSION bdr;
 
+CREATE EXTENSION bdr VERSION '0.10.0.2';
+DROP EXTENSION bdr;
+
 -- evolve version one by one from the oldest to the newest one
 CREATE EXTENSION bdr VERSION '0.8.0';
 ALTER EXTENSION bdr UPDATE TO '0.8.0.1';
@@ -70,6 +73,7 @@ ALTER EXTENSION bdr UPDATE TO '0.9.0.3';
 ALTER EXTENSION bdr UPDATE TO '0.9.0.4';
 ALTER EXTENSION bdr UPDATE TO '0.10.0.0';
 ALTER EXTENSION bdr UPDATE TO '0.10.0.1';
+ALTER EXTENSION bdr UPDATE TO '0.10.0.2';
 
 
 -- Should never have to do anything: You missed adding the new version above.