Open Nilanth opened 2 years ago
This kind of thing is not supported. A row filter can only look at its own table.
This kind of thing is not supported. A row filter can only look at its own table.
Thanks, Do u suggest any other tools for this case?
Sync related tables as whole units. Sync the comments
table, and user
tables in their entirety. If you need filters like the one you showed here, you need a different tool.
@bonesmoses Can you suggest any tool for this?
Another alternative is to modify your schema to include user_id
into the comments
table. Hence, you can use a row_filter: user_id = 1
.
How to sync associated table records using
replication_set_add_table
?I have tables like Users, Post, and Comments. We need to sync the
Comments
related to a user.Table Schema
Users id, name, email
Posts id, name, user_id
Comments id, comment, post_id
I tried with the below query but it doesn't work.
SELECT pglogical.replication_set_add_table(set_name := 'replication_set', relation := 'comments', synchronize_data := true, row_filter := 'post_id in (select id from posts where user_id = 1)');