You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/current/v25.2/create-logical-replication-stream.md
+9-12Lines changed: 9 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -20,21 +20,18 @@ If the table you're replicating does not contain [user-defined types]({% link {{
20
20
21
21
## Required privileges
22
22
23
-
{% include_cached new-in.html version="v25.2" %} To run the `CREATE LOGICAL REPLICATION STREAM` statement to create an LDR stream, the following privileges are required:
24
-
25
-
On the source cluster:
26
-
27
-
- The table-level `REPLICATIONSOURCE` privilege on the source table(s).
23
+
`CREATE LOGICAL REPLICATION STREAM` creates a one-way LDR stream only. To achieve bidirectional replication, you must manually create two separate streams, one in each direction, with the required privileges set on both clusters.
28
24
29
-
This is the user provided in the source URI when you start a LDR stream.
25
+
LDR from cluster A to B represents a one-way stream from a source to a destination cluster. LDR from cluster B to A is the reverse stream for a bidirectional setup.
30
26
31
-
On the destination cluster:
32
-
33
-
- The table-level `REPLICATIONDEST` privilege on the destination table(s).
34
-
35
-
For bidirectional LDR:
27
+
{% include_cached new-in.html version="v25.2" %} To run the `CREATE LOGICAL REPLICATION STREAM` statement to create an LDR stream, the following privileges are required:
36
28
37
-
- The user in the original source URI, who begins the reverse LDR stream, requires the table-level `REPLICATIONDEST` privilege.
29
+
LDR direction | Cluster | User role | Required privilege
A ➔ B | A | User in the LDR connection string. | `REPLICATIONSOURCE`
32
+
A ➔ B | B | User running the command. | `REPLICATIONDEST`
33
+
B ➔ A | B | User in the LDR connection string. | `REPLICATIONSOURCE`
34
+
B ➔ A | A | User running the command. | `REPLICATIONDEST`
38
35
39
36
Grant a table-level privilege with the [`GRANT`]({% link {{ page.version.version }}/grant.md %}) statement to a [user or a role]({% link {{ page.version.version }}/security-reference/authorization.md %}#users-and-roles):
Copy file name to clipboardExpand all lines: src/current/v25.2/create-logically-replicated.md
+11-12Lines changed: 11 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -22,21 +22,20 @@ This page is a reference for the `CREATE LOGICALLY REPLICATED` SQL statement, wh
22
22
23
23
## Required privileges
24
24
25
-
{% include_cached new-in.html version="v25.2" %} To run the `CREATE LOGICALLY REPLICATED` statement to create an LDR stream, the following privileges are required:
25
+
{% include_cached new-in.html version="v25.2" %} Users need the following privileges to create an LDR stream with `CREATE LOGICALLY REPLICATED`:
26
26
27
-
On the source cluster:
27
+
-**Source connection string user:** Needs the `REPLICATIONSOURCE` privilege on the source table(s). This is the user specified in the [source connection string]({% link {{ page.version.version }}/set-up-logical-data-replication.md %}#step-2-connect-from-the-destination-to-the-source) in unidirectional or bidirectional streams.
28
+
-**User starting the LDR stream on the destination:** Must have `CREATE` on the destination database **and** be the same user that is specified in the destination connection string for a bidirectional stream. The destination table will be created and the user given the `REPLICATIONDEST` privilege on the new table automatically.
29
+
-**For reverse (bidirectional) setup:** The original source user must have `REPLICATIONDEST` on the tables in the original source cluster.
28
30
29
-
- The table-level `REPLICATIONSOURCE` privilege on the source table(s).
31
+
LDR from cluster A to B represents a _unidirectional_ setup from a source to a destination cluster. LDR from cluster B to A is the reverse stream for a _bidirectional_ setup:
30
32
31
-
This is the user provided in the source URI when you start a LDR stream.
32
-
33
-
On the destination cluster:
34
-
35
-
-`CREATE` on the parent database of the new table, which allows for the automatic table creation.
36
-
37
-
For bidirectional LDR:
38
-
39
-
- The user in the original source URI, who begins the reverse LDR stream, requires the table-level `REPLICATIONDEST` privilege.
33
+
Replication direction | Cluster | User role | Required privileges
A ➔ B | A | User in source connection string. | `REPLICATIONSOURCE` on A's tables.
36
+
A ➔ B | B | User running `CREATE LOGICALLY REPLICATED` from the destination cluster. The destination table will be created and the user given the `REPLICATIONDEST` privilege on the new table automatically.<br>**Note:** Must match the user in the destination connection string for bidirectional LDR. | `CREATE` on B's parent database.
37
+
B ➔ A (reverse stream) | B | User in the new source connection string. | `REPLICATIONSOURCE` on B's tables.
38
+
Reverse replication requirement | A | Original source connection string user. | `REPLICATIONDEST` on A's tables.
40
39
41
40
Grant a table-level privilege with the [`GRANT`]({% link {{ page.version.version }}/grant.md %}) statement to a [user or a role]({% link {{ page.version.version }}/security-reference/authorization.md %}#users-and-roles):
Copy file name to clipboardExpand all lines: src/current/v25.2/set-up-logical-data-replication.md
+16-30Lines changed: 16 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -101,45 +101,31 @@ If you are setting up bidirectional LDR, you **must** run this step on both clus
101
101
CREATE USER {your_username} WITH PASSWORD '{your_password}';
102
102
~~~
103
103
104
-
Choose the appropriate privilege based on the SQL statement the user will run:
105
-
- [`CREATE LOGICAL REPLICATION STREAM`](#create-logical-replication-stream-existing-destination-table) (replicating into an **existing table**)
106
-
- [`CREATE LOGICALLY REPLICATED`](#create-logically-replicated-automatically-creates-destination-table) (creating a **new table** as part of the replication).
107
-
108
-
For details on which syntax to use, refer to the [Syntax](#syntax) section at the beginning of this tutorial.
104
+
1. Choose the appropriate privilege based on the SQL statement the user on the destination cluster will run. (For details on which syntax to use, refer to the [Syntax](#syntax) section at the beginning of this tutorial):
105
+
- [`CREATE LOGICAL REPLICATION STREAM`]({% link {{ page.version.version }}/create-logical-replication-stream.md %}) (replicating into an **existing table**). Grant the [`REPLICATIONDEST` privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#replicationdest) on the **destination table**, which allows the user to stream data into the existing table:
109
106
110
-
{{site.data.alerts.callout_info}}
111
-
If you are setting up bidirectional LDR, each cluster must **authorize both stream directions** using the table-level privileges. Ensure that you also grant privileges to users running the LDR stream in the reverse direction (from the original destination to the original source).
112
-
{{site.data.alerts.end}}
107
+
{% include_cached copy-clipboard.html %}
108
+
~~~sql
109
+
GRANT REPLICATIONDEST ON TABLE {your_db}.{your_schema}.{your_table} TO {your_username};
110
+
~~~
111
+
- [`CREATE LOGICALLY REPLICATED`]({% link {{ page.version.version }}/create-logically-replicated.md %}) (creating a **new table** as part of the replication). Grant the [`CREATE` privilege]({% link {{ page.version.version }}/create-database.md %}#required-privileges) on the **parent database**, which allows the user to create a new table in the specified database, and the user will automatically have `REPLICATIONDEST` on the table they create:
GRANT CREATE ON DATABASE {your_db} TO {your_username};
116
+
~~~
115
117
116
-
{% include_cached new-in.html version="v25.2" %} Grant the [`REPLICATIONDEST` privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#replicationdest) on the **destination table**:
117
-
118
-
{% include_cached copy-clipboard.html %}
119
-
~~~sql
120
-
GRANT REPLICATIONDEST ON TABLE {your_db}.{your_schema}.{your_table} TO {your_username};
121
-
~~~
122
-
123
-
This privilege allows the user to stream data into the existing table.
{% include_cached new-in.html version="v25.2" %} Grant the [`CREATE` privilege]({% link {{ page.version.version }}/create-database.md %}#required-privileges) on the **parent database**:
128
-
129
-
{% include_cached copy-clipboard.html %}
130
-
~~~sql
131
-
GRANT CREATE ON DATABASE {your_db} TO {your_username};
132
-
~~~
133
-
134
-
This allows the user to create a new table in the specified database, and the user will automatically have `REPLICATIONDEST` on the table they create.
135
-
136
-
1. {% include_cached new-in.html version="v25.2" %} On the **source**, grant the user who will be [specified in the connection string to the source cluster](#step-2-connect-from-the-destination-to-the-source) the [`REPLICATIONSOURCE` privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#replicationsource):
118
+
1. On the **source**, grant the user who will be [specified in the connection string to the source cluster](#step-2-connect-from-the-destination-to-the-source) the [`REPLICATIONSOURCE` privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#replicationsource):
137
119
138
120
{% include_cached copy-clipboard.html %}
139
121
~~~sql
140
122
GRANT REPLICATIONSOURCE ON TABLE {your_db}.{your_schema}.{your_table} TO {your_username};
141
123
~~~
142
124
125
+
1. (Optional) If you are setting up **bidirectional** LDR, each cluster must authorize both stream directions using the table-level privileges depending on the syntax you're using:
126
+
- [`CREATE LOGICAL REPLICATION STREAM`]({% link {{ page.version.version }}/create-logical-replication-stream.md %}) (setting up a reverse stream manually). Grant `REPLICATIONDEST` and `REPLICATIONSOURCE` to the users in the reverse direction.
127
+
- [`CREATE LOGICALLY REPLICATED`]({% link {{ page.version.version }}/create-logically-replicated.md %}) (setting up a bidirectional stream automatically). Grant the original source user `REPLICATIONDEST` on the tables.
128
+
143
129
{{site.data.alerts.callout_info}}
144
130
As of v25.2, the `REPLICATION` system privilege has been **deprecated** and replaced with the granular, table-level privileges: `REPLICATIONSOURCE` and `REPLICATIONDEST`.
0 commit comments