Re: bogus: logical replication rows/cols combinations
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Tomas Vondra <tomas.vondra@enterprisedb.com>, Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-29T05:05:12Z
Lists: pgsql-hackers
On Thu, Apr 28, 2022 at 5:56 PM Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote: > > On 27.04.22 12:33, Amit Kapila wrote: > > Currently, when the subscription has multiple publications, we combine > > the objects, and actions of those publications. It happens for > > 'publish_via_partition_root', publication actions, tables, column > > lists, or row filters. I think the whole design works on this idea > > even the initial table sync. I think it might need a major change > > (which I am not sure about at this stage) if we want to make the > > initial sync also behave similar to what you are proposing. > > If one publication says "publish if insert" and another publication says > "publish if update", then the combination of that is clearly "publish if > insert or update". Similarly, if one publication says "WHERE (foo)" and > one says "WHERE (bar)", then the combination is "WHERE (foo OR bar)". > > But if one publication says "publish columns a and b if condition-X" and > another publication says "publish columns a and c if not-condition-X", > then the combination is clearly *not* "publish columns a, b, c if true". > That is not logical, in the literal sense of that word. > So, what should be the behavior in the below cases: Case-1: pub1: "publish columns a and b if condition-X" pub2: "publish column c if condition-X" Isn't it okay to combine these? Case-2: pub1: "publish columns a and b if condition-X" pub2: "publish columns c if condition-Y" Here Y is subset of condition X (say something like condition-X: "col1 > 5" and condition-Y: "col1 > 10"). What should we do in such a case? I think if there are some cases where combining them is okay but in other cases, it is not okay then it is better to prohibit 'not-okay' cases if that is feasible. -- With Regards, Amit Kapila.
Commits
-
Prohibit combining publications with different column lists.
- fd0b9dcebda7 15.0 landed
-
Extend pg_publication_tables to display column list and row filter.
- 0ff20288e1cb 15.0 landed
-
Remove dynamic_shared_memory_type=none
- bcbd940806a2 12.0 cited