Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q77qk-00042t-0q for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jun 2023 05:06:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q77qh-0007S7-2r for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jun 2023 05:06:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q77qg-0007Ro-Ni for pgsql-hackers@lists.postgresql.org; Thu, 08 Jun 2023 05:06:14 +0000 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q77qa-000xPG-59 for pgsql-hackers@lists.postgresql.org; Thu, 08 Jun 2023 05:06:14 +0000 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1a2c9f087f0so198846fac.3 for ; Wed, 07 Jun 2023 22:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686200766; x=1688792766; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LzxoYITSYNLy0IDp0+kPAXPxTm96eRlsrSD0GtRa+4k=; b=XirfYvPhrVQiv7vFZYM1KW7cn3vr1k9YNL2irSffI7u73enGIXgaV3jq/4ROM43JDT zOy2KIYT9b0GNQbclWucAKHA0oNCTweI3vBkESCwmerAId4//CMudhtociLD5Lq4iSIS 5LpfRT3enyvEQ/87eiLEjd+gzyWguKKn2mlvZn1m4rWxjVGPEPDkX2b4Fly8pkiCsTSf Vb2hnyROU/h0JZk9gY0DcSNJloJbWHJPnG28d6D4yC888AbAri9iHe5Q+1ZeH5Gys5mA Duqwj12yYr93C46zm4GBx5pW2xj7rtmYhIApvhWH8jG6VGEETPbfWuV60cyPYcf0sTlu aJwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686200766; x=1688792766; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LzxoYITSYNLy0IDp0+kPAXPxTm96eRlsrSD0GtRa+4k=; b=fLJnIZQwH2d1kbCTWX3Prm6nmLeWbcX1DQRhhS3C68VMaZ+DJIbk4MunvsftpeO56R x7cH9kowTRKhbImGpgnonOQGS2qXPhM2+6jk3trTsZ/eIVmRM0RRqlJ+vIQK38f7BjJS Sasm8lkw+isPh2duXgr0FCFrSYQmytMPTx18+5L6lpKNFnmPIhf2YaWzj8gXeAfXm3u6 CvtoYqbZHGVDgP9JFmHnlGfhZsH5oGLriE9VR3uWwwrlZ1p6ObvRHZu8iQOt2UuWOH8A GuH5WoIsc18wDSjVJ/e+VWNzM0KcjeB7evwFhF1nlAsycqqzy7ADWMzcx9drtK6ot+89 Fm6Q== X-Gm-Message-State: AC+VfDydB+s8qzYt8oy+8uCGfaeq5pbCyE06dba06d6ip6SezCePxxJQ btFj3lJPxMu/hQy/aXlQir8RWm8tmr8hVBi8CaA= X-Google-Smtp-Source: ACHHUZ6TN/bTcwHv/CRiMJD8fVGdathunN4Ls+DgVdm4IBhCQKnXdKkfTA9lyJixOP+xGxa1tLOiz3H66ekNJ+GKRqo= X-Received: by 2002:a05:6870:d303:b0:18e:b6d5:7451 with SMTP id f3-20020a056870d30300b0018eb6d57451mr7032360oag.13.1686200766163; Wed, 07 Jun 2023 22:06:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Thu, 8 Jun 2023 10:35:54 +0530 Message-ID: Subject: Re: Support logical replication of DDLs To: shveta malik Cc: "Yu Shi (Fujitsu)" , vignesh C , "Zhijie Hou (Fujitsu)" , Ajin Cherian , "Wei Wang (Fujitsu)" , Runqi Tian , Peter Smith , Tom Lane , li jie , Dilip Kumar , Alvaro Herrera , Masahiko Sawada , Japin Li , rajesh singarapu , PostgreSQL Hackers , Zheng Li Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jun 6, 2023 at 4:26=E2=80=AFPM Amit Kapila wrote: > > > Few assorted comments: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Few comments on 0008* patch: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D 1. After 0008*, deparse_CreateStmt(), forms dpcontext before forming identity whereas it is required only after it. It may not matter practically but it is better to do the work when it is required. Also, before 0008, it appears to be formed after identity, so not sure if the change in 0008 is intentional, if so, then please let me know the reason, and may be it is better to add a comment for the same. 2. Similarly, what is need to separately do insert_identity_object() in deparse_CreateStmt() instead of directly doing something like new_objtree_for_qualname() as we are doing in 0001 patch? For this, I guess you need objtype handling in new_jsonb_VA(). 3. /* * It will be of array type for multi-columns table, so lets begin * an arrayobject. deparse_TableElems_ToJsonb() will add elements * to it. */ pushJsonbValue(&state, WJB_BEGIN_ARRAY, NULL); deparse_TableElems_ToJsonb(state, relation, node->tableElts, dpcontext, false, /* not typed table */ false); /* not composite */ deparse_Constraints_ToJsonb(state, objectId); pushJsonbValue(&state, WJB_END_ARRAY, NULL); This part of the code is repeated in deparse_CreateStmt(). Can we move this to a separate function? 4. * Note we ignore constraints in the parse node here; they are extracted fr= om * system catalogs instead. */ static void deparse_TableElems_ToJsonb(JsonbParseState *state, Relation relation, An extra empty line between the comments end and function appears unnecessa= ry. 5. + /* creat name and type elements for column */ /creat/create --=20 With Regards, Amit Kapila.