Where Clause not being applied to all tables in a publication

Started by Brad Nicholsonover 2 years ago2 messagesbugs
Jump to latest
#1Brad Nicholson
brad.nicholson@instacart.com

When adding more than one table to a logical replication publication with a
where clause, the where clause is only applied to a single table in the
publication, not all of them.

Basic test case:

testdb=# create table foo (id bigserial primary key);
CREATE TABLE
testdb=# create table bar (id bigserial primary key);
CREATE TABLE
testdb=# CREATE PUBLICATION test_pub for table foo,bar WHERE (id = 1);
CREATE PUBLICATION
testdb=# select * from pg_publication_tables \gx
-[ RECORD 1 ]--------
pubname | test_pub
schemaname | public
tablename | foo
attnames | {id}
rowfilter |
-[ RECORD 2 ]--------
pubname | test_pub
schemaname | public
tablename | bar
attnames | {id}
rowfilter | (id = 1)

Thanks,
Brad

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Brad Nicholson (#1)
Re: Where Clause not being applied to all tables in a publication

On Wednesday, August 30, 2023, Brad Nicholson <brad.nicholson@instacart.com>
wrote:

When adding more than one table to a logical replication publication with
a where clause, the where clause is only applied to a single table in the
publication, not all of them.

The observed behavior is precisely what the syntax describes.

David J.