Re: Support logical replication of DDLs

From: Zheng Li <zhengli10(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, 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-10-06 16:40:10
Message-ID: CAAD30UKg8rXeGM8Oy_MAmxKBL_K5DiHXdeNF=hUefcu1C_6VfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi,

Attaching v25 patch which adds supports for:
CREATE TRANSFORM
DROP TRANSFORM

These are relatively new commands so they're not in the original DDL
deparser patch.
Some tweaking is made in deparse_drop_command in order to make DROP
TRANSFORM deparsing work. This is because the objidentity captured in
currentEventTriggerState->SQLDropList contains the keyword 'on', for
example "for typename on language lang", but the keyword 'on' is not
needed in the current DROP TRANSFORM syntax. So we need to remove the
'on' keyword in objidentity. I'm not sure if this is the best way to
handle it, maybe
we can consider directly modifying what's captured in
currentEventTriggerState->SQLDropList
so we don't have the "on" keyword to begin with?

BTW, my colleague Runqi started a new thread to discuss DDL deparser
testing in [1].
Your feedback is appreciated.

With Regards,
Zheng Li

[1] https://www.postgresql.org/message-id/CAH8n8_jMTunxxtP4L-3tc%3DGNamg%3Dmg1X%3DtgHr9CqqjjzFLwQng%40mail.gmail.com

Attachment Content-Type Size
v25-0005-Add-DDL-deparser-support-for-TEXT-SEARCH-commands-wh.patch application/octet-stream 18.4 KB
v25-0003-Support-CREATE-TABLE-AS-SELECT-INTO.patch application/octet-stream 15.0 KB
v25-0002-Support-DDL-replication.patch application/octet-stream 129.4 KB
v25-0004-Test-cases-for-DDL-replication.patch application/octet-stream 24.6 KB
v25-0001-Functions-to-deparse-DDL-commands.patch application/octet-stream 257.0 KB
v25-0006-Support-CREATE-TRANSFORM-and-DROP-TRANSFORM-commands.patch application/octet-stream 8.6 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2022-10-06 16:46:26 Re: pg_restore creates public schema?
Previous Message Tom Lane 2022-10-06 15:20:37 Re: pg_restore creates public schema?

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-10-06 17:16:01 Re: Support logical replication of DDLs
Previous Message Alvaro Herrera 2022-10-06 16:28:36 Re: pgsql: Avoid improbable PANIC during heap_update.