From 2231e6e1876b27424f0a3f7dc65ef42b6949101c Mon Sep 17 00:00:00 2001 From: Dmitry Yemanov Date: Wed, 15 Apr 2020 16:39:17 +0300 Subject: [PATCH] Documentation --- doc/README.replication.md | 19 +++++++++++++++++- doc/sql.extensions/README.ddl.txt | 32 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/doc/README.replication.md b/doc/README.replication.md index bb83f24e19..fa095cc4e5 100644 --- a/doc/README.replication.md +++ b/doc/README.replication.md @@ -30,7 +30,24 @@ All replication errors and warnings \(e.g. detected conflicts\) are written into Replication is configured using a single configuration file: replication.conf. It allows to define global settings as well as per-database settings. All the possible options are listed inside replication.conf, descriptions are provided as comments there. For per-database configuration, full database name must be specified \(aliases or wildcards are not allowed\) inside the {database} section. -Tables to be replicated can be customized using two settings: include\_filter and exclude\_filter. They are regular expressions that are applied to table names and define rules for inclusion table\(s\) into the replication set or excluding them from the replication set. +Inside the database, replication should be enabled via the DDL command: +ALTER DATABASE ENABLE PUBLICATION + +Also, the replication set (aka publication) should be defined. It includes tables that should be replicated. This is also done via the DDL command: + +-- to replicate all tables (including the ones created later): +ALTER DATABASE ADD ALL TO PUBLICATION +-- to replicate specific tables: +ALTER DATABASE ADD TABLE T1, T2, T3 TO PUBLICATION + +Tables may later be excluded from the replication set: + +-- to disable replication of all tables (including the ones created later): +ALTER DATABASE DROP ALL FROM PUBLICATION +-- to disable replication of specific tables: +ALTER DATABASE DROP TABLE T1, T2, T3 FROM PUBLICATION + +Tables enabled for replicated can be additionally filtered using two settings in the configuration file: include\_filter and exclude\_filter. They are regular expressions that are applied to table names and define rules for inclusion table\(s\) into the replication set or excluding them from the replication set. Synchronous replication can be turned on using the sync\_replica setting \(multiple entries are allowed\). It must specify a connection string to the replica database, prefixed with username/password. In SuperServer and SuperClassic architectures, replica database is being internally attached when the first user gets connected to the master database and detached when the last user disconnects from the master database. In Classic Server architecture, every server process keeps an active connection to the replica database. diff --git a/doc/sql.extensions/README.ddl.txt b/doc/sql.extensions/README.ddl.txt index 3b71255952..bc39bd0d03 100644 --- a/doc/sql.extensions/README.ddl.txt +++ b/doc/sql.extensions/README.ddl.txt @@ -569,3 +569,35 @@ suppoprted now. Example: GRANT ALL ON PLG$SRP_VIEW TO SYSTEM PRIVILEGE USER_MANAGEMENT Grants all rights to view (used in SRP management plugin) to users having USER_MANAGEMENT privilege. + +22) Added replication control clauses to ALTER DATABASE statement. +(Dmitry Yemanov) + +ALTER DATABASE {ENABLE | DISABLE} PUBLICATION + +Enables or disabled replication. The change is applied immediately. + +ALTER DATABASE ADD ALL TO PUBLICATION + +Enables replication for all tables inside the database, including the ones to be created in the future. + +ALTER DATABASE ADD TABLE {, , ..., } TO PUBLICATION + +Enables replication for the specified set of tables. + +ALTER DATABASE DROP ALL FROM PUBLICATION + +Disables replication for all tables inside the database, including the ones to be created in the future. + +ALTER DATABASE DROP TABLE {, , ..., } FROM PUBLICATION + +Disables replication for the specified set of tables. + +23) Added optional replication control clauses to CREATE TABLE and ALTER TABLE statements. +(Dmitry Yemanov) + +CREATE TABLE ... [ {ENABLE | DISABLE} PUBLICATION ] +ALTER TABLE ... [ {ENABLE | DISABLE} PUBLICATION ] + +Defines whether replication is enabled for the specified table. +If not specified in the CREATE TABLE statement, the database-level default behaviour is applied.