Re: Support logical replication of DDLs

From: Zheng Li <zhengli10(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, rajesh(dot)rs0541(at)gmail(dot)com
Subject: Re: Support logical replication of DDLs
Date: 2022-04-11 16:42:01
Message-ID: CAAD30UKeRsGfqqTC-qTf_3auqz43FTTHhfhbi3b_1_=ye818fw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi,

> > Good catch. The reason for having isTopLevel in the condition is
> > because I haven't decided if a DDL statement inside a PL should
> > be replicated from the user point of view. For example, if I execute a
> > plpgsql function or a stored procedure which creates a table under the hood,
> > does it always make sense to replicate the DDL without running the same
> > function or stored procedure on the subscriber? It probably depends on
> > the specific
> > use case. Maybe we can consider making this behavior configurable by the user.
>
> But then this could be true for DML as well right? Like after
> replicating the function to the subscriber if we are sending the DML
> done by function then what's the problem in DDL. I mean if there is
> no design issue in implementing this then I don't think there is much
> point in blocking the same or even providing configuration for this.

Agreed. I'll unblock DDLs in functions/procedures and test it out. I
find out some DDLs in functions are replicated multiple times on the
subscriber while they should only be replicated once. Still trying to
figure out why.

>The patch no longer applies. The patch is a very good attempt, and I
>would also like to contribute if required.
>I have a few comments but will hold it till a rebased version is available.

Hi, Ajin. That'll be great! I'll rebase my github branch to master
head. In the meantime, this github branch still works
https://github.com/zli236/postgres/tree/ddl_replication

Regards,
Zheng

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zheng Li 2022-04-11 17:31:17 Re: Support logical replication of DDLs
Previous Message David G. Johnston 2022-04-11 16:05:31 Re: PostgreSQL : error hint for LATERAL join

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2022-04-11 16:44:08 Re: make MaxBackends available in _PG_init
Previous Message Tom Lane 2022-04-11 16:28:47 Re: avoid multiple hard links to same WAL file after a crash