postgresql/src/backend/commands
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
..
Makefile Move parallel vacuum code to vacuumparallel.c. 2021-12-23 11:42:52 +05:30
aggregatecmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
alter.c Wake up a subscription's replication worker processes after DDL. 2023-01-06 17:27:58 -05:00
amcmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
analyze.c Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
async.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
cluster.c Fix MAINTAIN privileges for toast tables and partitions. 2023-01-14 00:16:23 -08:00
collationcmds.c Validate ICU locales. 2023-03-28 16:34:29 -07:00
comment.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
constraint.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
conversioncmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
copy.c Improve several permission-related error messages. 2023-03-17 10:33:09 +01:00
copyfrom.c Ignore BRIN indexes when checking for HOT updates 2023-03-20 11:02:42 +01:00
copyfromparse.c Don't try to read default for a non-existent attribute 2023-03-15 17:20:42 -04:00
copyto.c Ensure COPY TO on an RLS-enabled table copies no more than it should. 2023-03-10 13:52:44 -05:00
createas.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
dbcommands.c Validate ICU locales. 2023-03-28 16:34:29 -07:00
define.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
discard.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
dropcmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
event_trigger.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
explain.c Invent GENERIC_PLAN option for EXPLAIN. 2023-03-24 17:07:22 -04:00
extension.c Add @extschema:name@ and no_relocate options to extensions. 2023-03-20 18:37:11 -04:00
foreigncmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
functioncmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
indexcmds.c Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
lockcmds.c Get rid of the "new" and "old" entries in a view's rangetable. 2023-01-18 13:23:57 -05:00
matview.c Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
opclasscmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
operatorcmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
policy.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
portalcmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
prepare.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
proclang.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
publicationcmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
schemacmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
seclabel.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
sequence.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
statscmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
subscriptioncmds.c Avoid syncing data twice for the 'publish_via_partition_root' option. 2023-03-29 10:46:58 +05:30
tablecmds.c Save a few bytes in pg_attribute 2023-03-28 10:05:56 +02:00
tablespace.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
trigger.c Fix concurrent update issues with MERGE. 2023-03-13 10:22:22 +00:00
tsearchcmds.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
typecmds.c Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
user.c Fix typo 2023-03-17 21:40:25 +01:00
vacuum.c Fix fractional vacuum_cost_delay. 2023-03-15 13:58:18 +13:00
vacuumparallel.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
variable.c Fix outdated references to guc.c 2023-03-02 13:49:39 +01:00
view.c Get rid of the "new" and "old" entries in a view's rangetable. 2023-01-18 13:23:57 -05:00