postgresql/src/backend
Tomas Vondra 5a07966225 Fix row filters with multiple publications
When publishing changes through a artition root, we should use the row
filter for the top-most ancestor. The relation may be added to multiple
publications, using different ancestors, and 52e4f0cd47 handled this
incorrectly. With c91f71b9dc we find the correct top-most ancestor, but
the code tried to fetch the row filter from all publications, including
those using a different ancestor etc. No row filter can be found for
such publications, which was treated as replicating all rows.

Similarly to c91f71b9dc, this seems to be a rare issue in practice. It
requires multiple publications including the same partitioned relation,
through different ancestors.

Fixed by only passing publications containing the top-most ancestor to
pgoutput_row_filter_init(), so that treating a missing row filter as
replicating all rows is correct.

Report and fix by me, test case by Hou zj. Reviews and improvements by
Amit Kapila.

Author: Tomas Vondra, Hou zj, Amit Kapila
Reviewed-by: Amit Kapila, Hou zj
Discussion: https://postgr.es/m/d26d24dd-2fab-3c48-0162-2b7f84a9c893%40enterprisedb.com
2022-03-17 17:03:48 +01:00
..
access Fix race between DROP TABLESPACE and checkpointing. 2022-03-16 17:20:24 +13:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog Add option to use ICU as global locale provider 2022-03-17 11:13:16 +01:00
commands Add option to use ICU as global locale provider 2022-03-17 11:13:16 +01:00
executor Split ExecUpdate and ExecDelete into reusable pieces 2022-03-17 11:47:04 +01:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit Silence LLVM 14 API deprecation warnings. 2022-03-16 10:30:55 +13:00
lib dshash: Add sequential scan support. 2022-03-10 12:57:05 -08:00
libpq Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
main Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
nodes Allow specifying row filters for logical replication of tables. 2022-02-22 08:11:50 +05:30
optimizer Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
parser Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
partitioning Fix misuse of "const" qualifier. 2022-02-13 19:20:56 -05:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster Wake up for latches in CheckpointWriteDelay(). 2022-03-16 13:57:59 +13:00
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication Fix row filters with multiple publications 2022-03-17 17:03:48 +01:00
rewrite Update copyright for 2022 2022-01-07 19:04:57 -05:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
storage Fix race between DROP TABLESPACE and checkpointing. 2022-03-16 17:20:24 +13:00
tcop Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
tsearch Update copyright for 2022 2022-01-07 19:04:57 -05:00
utils Add option to use ICU as global locale provider 2022-03-17 11:13:16 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00