Skip to content

Commit 60e456e

Browse files
committed
improve publication-related docs for Postgres
1 parent e157c00 commit 60e456e

11 files changed

Lines changed: 84 additions & 13 deletions

File tree

docs/integrations/data-ingestion/clickpipes/postgres/faq.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ These adjustments should significantly enhance the performance of the initial lo
180180
181181
### How should I scope my publications when setting up replication? {#how-should-i-scope-my-publications-when-setting-up-replication}
182182
183-
You can let ClickPipes manage your publications (requires additional permissions) or create them yourself. With ClickPipes-managed publications, we automatically handle table additions and removals as you edit the pipe. If self-managing, carefully scope your publications to only include tables you need to replicate - including unnecessary tables will slow down Postgres WAL decoding.
183+
We don't recommend creating a publication `FOR ALL TABLES`, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe). This will slow down Postgres WAL decoding and reduce overall efficiency.
184184

185185
If you include any table in your publication, make sure it has either a primary key or `REPLICA IDENTITY FULL`. If you have tables without a primary key, creating a publication for all tables will cause DELETE and UPDATE operations to fail on those tables.
186186

@@ -213,9 +213,7 @@ You have two options when dealing with tables without primary keys:
213213
```
214214

215215
:::tip
216-
If you're creating a publication manually instead of letting ClickPipes manage it, we don't recommend creating a publication `FOR ALL TABLES`, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
217-
218-
For manually created publications, please add any tables you want to the publication before adding them to the pipe.
216+
Alternatively, ClickPipes can manage publications on your behalf, automatically handling table additions and removals as you modify the pipe. Note that this requires the database user to have both the `CREATE` permission on the database and ownership of the replicated tables, meaning the user cannot be configured with read-only access.
219217
:::
220218

221219
:::warning

docs/integrations/data-ingestion/clickpipes/postgres/source/aurora.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,17 @@ Connect to your Aurora PostgreSQL writer instance as an admin user and execute t
9191
4. Create a publication for replication:
9292

9393
```sql
94-
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
94+
CREATE PUBLICATION clickpipes_publication FOR TABLE <...>, <...>;
9595
```
9696

97+
:::tip
98+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
99+
:::
100+
101+
:::note
102+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
103+
:::
104+
97105
## Configure network access {#configure-network-access}
98106
99107
### IP-based access control {#ip-based-access-control}

docs/integrations/data-ingestion/clickpipes/postgres/source/azure-flexible-server-postgres.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,17 @@ Connect to your Azure Flexible Server Postgres through the admin user and run th
6060
4. Create publication that you'll be using for creating the MIRROR (replication) in future.
6161

6262
```sql
63-
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
63+
CREATE PUBLICATION clickpipes_publication FOR TABLE <...>, <...>;
6464
```
6565

66+
:::tip
67+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
68+
:::
69+
70+
:::note
71+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
72+
:::
73+
6674
5. Set `wal_sender_timeout` to 0 for `clickpipes_user`
6775

6876
```sql

docs/integrations/data-ingestion/clickpipes/postgres/source/crunchy-postgres.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,17 @@ Connect to your Crunchy Bridge Postgres through the `postgres` user and run the
5252
4. Create publication that you'll be using for creating the MIRROR (replication) in future.
5353
5454
```sql
55-
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
55+
CREATE PUBLICATION clickpipes_publication FOR TABLE <...>, <...>;
5656
```
5757
58+
:::tip
59+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
60+
:::
61+
62+
:::note
63+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
64+
:::
65+
5866
## Safe list ClickPipes IPs {#safe-list-clickpipes-ips}
5967

6068
Safelist [ClickPipes IPs](../../index.md#list-of-static-ips) by adding the Firewall Rules in Crunchy Bridge.

docs/integrations/data-ingestion/clickpipes/postgres/source/generic.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,22 @@ For this, you can connect to your Postgres instance and run the following SQL co
6868
ALTER USER clickpipes_user REPLICATION;
6969
7070
-- Create a publication. We will use this when creating the pipe
71-
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
71+
CREATE PUBLICATION clickpipes_publication FOR TABLE <...>, <...>;
7272
```
7373
:::note
7474

7575
Make sure to replace `clickpipes_user` and `clickpipes_password` with your desired username and password.
7676

7777
:::
7878

79+
:::tip
80+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
81+
:::
82+
83+
:::note
84+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
85+
:::
86+
7987
## Enabling connections in pg_hba.conf to the ClickPipes User {#enabling-connections-in-pg_hbaconf-to-the-clickpipes-user}
8088
8189
If you are self serving, you need to allow connections to the ClickPipes user from the ClickPipes IP addresses by following the below steps. If you are using a managed service, you can do the same by following the provider's documentation.

docs/integrations/data-ingestion/clickpipes/postgres/source/google-cloudsql.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,17 @@ Connect to your Cloud SQL Postgres through the admin user and run the below comm
7070
4. Create publication that you'll be using for creating the MIRROR (replication) in future.
7171

7272
```sql
73-
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
73+
CREATE PUBLICATION clickpipes_publication FOR TABLE <...>, <...>;
7474
```
7575

76+
:::tip
77+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
78+
:::
79+
80+
:::note
81+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
82+
:::
83+
7684
[//]: # (TODO Add SSH Tunneling)
7785

7886
## Add ClickPipes IPs to Firewall {#add-clickpipes-ips-to-firewall}

docs/integrations/data-ingestion/clickpipes/postgres/source/neon-postgres.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ Here, we can run the following SQL commands:
3737
ALTER USER clickpipes_user REPLICATION;
3838

3939
-- Create a publication. We will use this when creating the mirror
40-
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
40+
CREATE PUBLICATION clickpipes_publication FOR TABLE <...>, <...>;
4141
```
42+
:::tip
43+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
44+
:::
45+
46+
:::note
47+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
48+
:::
4249

4350
<Image size="lg" img={neon_commands} alt="User and publication commands" border/>
4451

docs/integrations/data-ingestion/clickpipes/postgres/source/planetscale.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ For this, you can connect to your PlanetScale Postgres instance using the defaul
6969
Make sure to replace `clickpipes_user` and `clickpipes_password` with your desired username and password.
7070
:::
7171

72+
:::tip
73+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
74+
:::
75+
76+
:::note
77+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
78+
:::
79+
7280
## Caveats {#caveats}
7381
1. To connect to PlanetScale Postgres, the current branch needs to be appended to the username created above. For example, if the created user was named `clickpipes_user`, the actual user provided during the ClickPipe creation needs to be `clickpipes_user`.`branch` where `branch` refers to the "id" of the current PlanetScale Postgres [branch](https://planetscale.com/docs/postgres/branching). To quickly determine this, you can refer to the username of the `postgres` user you used to create the user earlier, the part after the period would be the branch id.
7482
2. Do not use the `PSBouncer` port (currently `6432`) for CDC pipes connecting to PlanetScale Postgres, the normal port `5432` must be used. Either port may be used for initial-load only pipes.

docs/integrations/data-ingestion/clickpipes/postgres/source/rds.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,17 @@ Connect to your RDS Postgres instance as an admin user and execute the following
9191
4. Create a publication for replication:
9292

9393
```sql
94-
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
94+
CREATE PUBLICATION clickpipes_publication FOR TABLE <...>, <...>;
9595
```
9696

97+
:::tip
98+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
99+
:::
100+
101+
:::note
102+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
103+
:::
104+
97105
## Configure network access {#configure-network-access}
98106
99107
### IP-based access control {#ip-based-access-control}

docs/integrations/data-ingestion/clickpipes/postgres/source/supabase.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ Here, we can run the following SQL commands:
3838
ALTER USER clickpipes_user REPLICATION;
3939

4040
-- Create a publication. We will use this when creating the mirror
41-
CREATE PUBLICATION clickpipes_publication FOR ALL TABLES;
41+
CREATE PUBLICATION clickpipes_publication FOR TABLE <...>, <...>;
4242
```
4343

44+
:::tip
45+
We don't recommend creating a publication `FOR ALL TABLES` unless you are replicating all tables, this leads to more traffic from Postgres to ClickPipes (to sending changes for other tables not in the pipe) and reduces overall efficiency.
46+
:::
47+
48+
:::note
49+
ClickPipes can automatically create and manage the publication on your behalf. However, this requires granting the ClickPipes user both table ownership and the `CREATE` permission on the database. If you prefer read-only access for the ClickPipes user, we recommend creating and managing the publication manually.
50+
:::
51+
4452
<Image img={supabase_commands} alt="User and publication commands" size="large" border/>
4553

4654
Click on **Run** to have a publication and a user ready.

0 commit comments

Comments
 (0)