Re: Support logical replication of DDLs

From: Zheng Li <zhengli10(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Japin Li <japinli(at)hotmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, rajesh singarapu <rajesh(dot)rs0541(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support logical replication of DDLs
Date: 2022-05-13 21:01:33
Message-ID: CAAD30U+CRgUgkAg33KzNBKwCbsgiSc5z3NYvxNzEfS0Zg2S1WA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> > 4. The handling related to partition tables seems missing because, on
> > the subscriber-side, it always creates a relation entry in
> > pg_subscription_rel which won't work. Check its interaction with
> > publish_via_partition_root.
>
> I will test it out.

Hi,

patch 0010 properly handles partitioned table creation on the apply
worker. Whether a replicated partitioned table should be added to
pg_subscription_rel catalog depends on the setting of
publish_via_partition_root of the publication. Thus we need to connect
to the source DB and check if the partitioned table is in
pg_catalog.pg_publication_tables after the apply worker creates the
partitioned table.

Thanks to Borui Yang for enabling and testing replication of DDL type
T_RenameStmt in patch 0009.

I've also rebased all the patches. Github branch of the same change
can be found here:
https://github.com/zli236/postgres/commits/ddl_replication

Regards,
Zheng

Attachment Content-Type Size
0005-Support-replication-of-CREATE-.-AS-.-and-SELECT-.-IN.patch application/octet-stream 8.0 KB
0002-Support-logical-logging-and-decoding-of-DDL-command-.patch application/octet-stream 61.4 KB
0003-Logical-replication-of-DDL-messages.patch application/octet-stream 41.2 KB
0004-Enable-replication-of-CREATE-MATERIALIZED-VIEW-AS-st.patch application/octet-stream 4.1 KB
0006-Add-couple-tests-for-DDL-replication-case.patch application/octet-stream 4.5 KB
0009-Support-replication-of-DDL-type-T_RenameStmt-table-r.patch application/octet-stream 8.3 KB
0001-Define-DDL-replication-levels-via-the-CREATE-PUBLICA.patch application/octet-stream 65.0 KB
0007-Enable-logging-and-replication-of-DDLs-executed-insi.patch application/octet-stream 17.5 KB
0008-Fail-replication-worker-on-DDL-command-that-rewrites.patch application/octet-stream 4.8 KB
0010-Handle-partitioned-table-creation-on-the-apply-worke.patch application/octet-stream 11.5 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bryn Llewellyn 2022-05-16 19:03:12 Re: Deferred constraint trigger semantics
Previous Message Niels Jespersen 2022-05-13 16:25:21 Logon via GSSAPI from Linux fails, but works from Windows

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-05-13 21:25:08 Re: Backends stunk in wait event IPC/MessageQueueInternal
Previous Message Mikael Kjellström 2022-05-13 20:35:22 Re: recovery test failure on morepork with timestamp mystery