Re: Support logical replication of DDLs

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Zheng Li <zhengli10@gmail.com>
Cc: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Japin Li <japinli@hotmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Dilip Kumar <dilipbalaut@gmail.com>, rajesh singarapu <rajesh.rs0541@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Peter Smith <smithpb2250@gmail.com>
Date: 2022-08-12T10:32:35Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add a run_as_owner option to subscriptions.

  2. Refactor pgoutput_change().

  3. Print the correct aliases for DML target tables in ruleutils.

  4. Fix object identity string for transforms

  5. Add grantable MAINTAIN privilege and pg_maintain role.

  6. Get rid of recursion-marker values in enum AlterTableType

  7. Release cache tuple when no longer needed

  8. Empty search_path in logical replication apply worker and walsender.

  9. Refactor format_type APIs to be more modular

  10. Use wrappers of PG_DETOAST_DATUM_PACKED() more.

On Tue, Aug 9, 2022 at 1:52 AM Zheng Li <zhengli10@gmail.com> wrote:
>
> > In general, I agree with your comment below that we can work on this
> > after we have some more concrete plans/discussions. I think we can
> > probably consider this when we have more discussion around the
> > publication commands for the DDL objects. However, it would be good if
> > you can add some more details about the above two options.
>
> Thanks for the support. I have started a new thread on supporting replication of
> global object command and have added more detailed discussion:
> https://www.postgresql.org/message-id/CAAD30UKD7YPEbYcs_L9PYLcLZjnxyqO%3DJF5_mnAwx7g_PtOi3A%40mail.gmail.com
>
> > I noticed that LogLogicalDDLMessage() uses MyDatabaseId and then
> > decoding can take some action (filtering) based on that. Is it Okay to
> > use that function for global objects, if so, you might want to add a
> > comment for the same?
>
> Could you elaborate on the concern? The dbid filtering happens in
> logicalddlmsg_decode but I don't see why I can't use LogLogicalDDLMessage
> to log global commands.
>

I thought one may not want to tie replication of global objects with
any particular database. I read your ideas on the thread [1] about the
same but am not sure of the best way forward for it.

[1] - https://www.postgresql.org/message-id/CAAD30UKD7YPEbYcs_L9PYLcLZjnxyqO%3DJF5_mnAwx7g_PtOi3A%40mail.gmail.com

-- 
With Regards,
Amit Kapila.