postgresql/src/backend
Amit Kapila 062a844424 Avoid syncing data twice for the 'publish_via_partition_root' option.
When there are multiple publications for a subscription and one of those
publishes via the parent table by using publish_via_partition_root and the
other one directly publishes the child table, we end up copying the same
data twice during initial synchronization. The reason for this was that we
get both the parent and child tables from the publisher and try to copy
the data for both of them.

This patch extends the function pg_get_publication_tables() to take a
publication list as its input parameter. This allows us to exclude a
partition table whose ancestor is published by the same publication list.

This problem does exist in back-branches but we decide to fix it there in
a separate commit if required. The fix for back-branches requires quite
complicated changes to fetch the required table information from the
publisher as we can't update the function pg_get_publication_tables() in
back-branches. We are not sure whether we want to deviate and complicate
the code in back-branches for this problem as there are no field reports
yet.

Author: Wang wei
Reviewed-by: Peter Smith, Jacob Champion, Kuroda Hayato, Vignesh C, Osumi Takamichi, Amit Kapila
Discussion: https://postgr.es/m/OS0PR01MB57167F45D481F78CDC5986F794B99@OS0PR01MB5716.jpnprd01.prod.outlook.com
2023-03-29 10:46:58 +05:30
..
access Save a few bytes in pg_attribute 2023-03-28 10:05:56 +02:00
archive Redesign archive modules 2023-02-17 14:26:42 +09:00
backup Improve several permission-related error messages. 2023-03-17 10:33:09 +01:00
bootstrap Fix CREATE INDEX progress reporting for multi-level partitioning. 2023-03-25 15:34:03 -04:00
catalog Avoid syncing data twice for the 'publish_via_partition_root' option. 2023-03-29 10:46:58 +05:30
commands Avoid syncing data twice for the 'publish_via_partition_root' option. 2023-03-29 10:46:58 +05:30
executor Fix oversights in array manipulation. 2023-03-26 13:41:06 -04:00
foreign Update copyright for 2023 2023-01-02 15:00:37 -05:00
jit Fix incorrect format placeholders 2023-03-10 07:10:43 +01:00
lib Fix ILIST_DEBUG build 2023-01-18 10:26:15 -08:00
libpq Make SCRAM iteration count configurable 2023-03-27 09:46:29 +02:00
main Mark options as deprecated in usage output 2023-03-02 14:36:37 +01:00
nodes Fix make maintainer-clean with queryjumblefuncs.*.c files in src/backend/nodes/ 2023-03-22 07:51:16 +09:00
optimizer Fix corner-case planner failure for MERGE. 2023-03-28 11:39:24 -04:00
parser Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
partitioning Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
po meson: add install-{quiet, world} targets 2023-03-23 21:20:18 -07:00
port Update copyright for 2023 2023-01-02 15:00:37 -05:00
postmaster Comment on expectations for AutoVacuumWorkItem handlers. 2023-03-25 13:00:27 -07:00
regex Refactor to introduce pg_locale_deterministic(). 2023-02-23 11:17:41 -08:00
replication Allow logical replication to copy tables in binary format. 2023-03-23 08:45:51 +05:30
rewrite Fix more bugs caused by adding columns to the end of a view. 2023-03-07 18:21:53 -05:00
snowball Update copyright for 2023 2023-01-02 15:00:37 -05:00
statistics Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
storage Fix memory leak and inefficiency in CREATE DATABASE ... STRATEGY WAL_LOG 2023-03-22 09:20:34 -07:00
tcop Fix CREATE INDEX progress reporting for multi-level partitioning. 2023-03-25 15:34:03 -04:00
tsearch Fix t_isspace(), etc., when datlocprovider=i and datctype=C. 2023-03-17 12:08:46 -07:00
utils Validate ICU locales. 2023-03-28 16:34:29 -07:00
.gitignore
Makefile Redesign archive modules 2023-02-17 14:26:42 +09:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build meson: Prevent installation of test files during main install 2023-03-03 07:45:52 +01:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00