public inbox for [email protected]  
help / color / mirror / Atom feed
From: [email protected] <[email protected]>
To: [email protected] <[email protected]>
Cc: vignesh C <[email protected]>
Cc: Zheng Li <[email protected]>
Cc: li jie <[email protected]>
Cc: Dilip Kumar <[email protected]>
Cc: Ajin Cherian <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Amit Kapila <[email protected]>
Cc: Masahiko Sawada <[email protected]>
Cc: Japin Li <[email protected]>
Cc: rajesh singarapu <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: RE: Support logical replication of DDLs
Date: Thu, 9 Mar 2023 09:58:52 +0000
Message-ID: <OS0PR01MB57166D4E3E8FC3B5DF6A6ABB94B59@OS0PR01MB5716.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <OS3PR01MB62752246D2A718126825A1809EB59@OS3PR01MB6275.jpnprd01.prod.outlook.com>
References: <CAHut+PusvDXTJa2drUPzePBBW0i9we8yns8Z4DU4b7JVs6Ew1Q@mail.gmail.com>
	<CAFPTHDa6aHhwZkQ+GjFNL1dSQbMfoEtN-6y9wseMywCLdKuUYQ@mail.gmail.com>
	<OS3PR01MB6275FE40496DA47C0A3369289EB69@OS3PR01MB6275.jpnprd01.prod.outlook.com>
	<OS3PR01MB62752246D2A718126825A1809EB59@OS3PR01MB6275.jpnprd01.prod.outlook.com>

On Thur, Mar 9, 2023 10:27 AM Wang, Wei/王 威 <[email protected]>
> On Mon, Mar 6, 2023 18:17 PM Wang, Wei/王 威 <[email protected]>
> wrote:
> > On Mon, Mar 6, 2023 14:34 AM Ajin Cherian <[email protected]> wrote:
> > > Changes are in patch 1 and patch 2
> >
> > Thanks for updating the patch set.
> >
> > Here are some comments:
> 
> Here are some more comments for v-75-0002* patch:

Thanks for your comments.

> 1. In the function deparse_AlterRelation
> +		if ((sub->address.objectId != relId &&
> +			 sub->address.objectId != InvalidOid) &&
> +			!(subcmd->subtype == AT_AddConstraint &&
> +			  subcmd->recurse) &&
> +			istable)
> +			continue;
> I think when we execute the command "ALTER TABLE ... CLUSTER ON" 
> (subtype is AT_ClusterOn), this command will be skipped for parsing. I 
> think we need to parse this command here.
> 
> I think we are skipping some needed parsing due to this check, such as 
> [1].#1 and the AT_ClusterOn command mentioned above. After reading the 
> thread, I think the purpose of this check is to fix the bug in [2] 
> (see the last point in [2]).
> I think maybe we could modify this check to `continue` when
> sub->address.objectId and relId are inconsistent and 
> sub->sub->address.objectId is a
> child (inherited or partition) table. What do you think?

Fixed as suggested.

> ~~~
> 
> 2. In the function deparse_CreateStmt
> I think when we execute the following command:
>     `CREATE TABLE tbl (a int GENERATED ALWAYS AS (1) STORED);` the 
> deparsed result is :
>     `CREATE  TABLE  public.tbl (a pg_catalog.int4 STORAGE plain 
> GENERATED ALWAYS AS 1 STORED);` I think the parentheses around 
> generation_expr(I mean `1`) are missing, which would cause a syntax 
> error.

Fixed.

> ~~~
> 
> 3. In the function deparse_IndexStmt
> I think we missed parsing of options [NULLS NOT DISTINCT] in the 
> following
> command:
> ```
> CREATE UNIQUE INDEX ... ON table_name ... NULLS NOT DISTINCT; ``` I 
> think we could check this option via node->nulls_not_distinct.

Fixed.

Best Regards,
Hou zj


view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: RE: Support logical replication of DDLs
  In-Reply-To: <OS0PR01MB57166D4E3E8FC3B5DF6A6ABB94B59@OS0PR01MB5716.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox