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 1ptgHP-0000P9-Ei for pgsql-hackers@arkaria.postgresql.org; Tue, 02 May 2023 03:02:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ptgGQ-0004Mt-E0 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 May 2023 03:01:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ptgGQ-0004Mi-4m for pgsql-hackers@lists.postgresql.org; Tue, 02 May 2023 03:01:14 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ptgGK-0002u8-Ij for pgsql-hackers@lists.postgresql.org; Tue, 02 May 2023 03:01:12 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3062b101ae1so1256104f8f.2 for ; Mon, 01 May 2023 20:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682996466; x=1685588466; 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=Z8+VX4iFUOOuDAJt+noS7zgRzfcMEdZ5w8Wf3gUNnn8=; b=YzSNGx2Laho5JAjNqD43iGpzzRFOvbqwf4IVL2hSh2FF5AUpURZW97OVycGYHIdoUM TsoESMUYdL3iHoFFSfoG/JS/NSER6ewRCCALTfdnn0n9AthgchG5g+PRITuoZRjmOAMF wKPzI7ESqw8CrFKxde4EMzfAVLn/F+c6XMiFC26+dc5Bciz0LB0LWQrP3IvNj8ys4+Mu 6DTtojS54+PC4L113vK8DHhwBOelniMbMQREg7rPaY1lAzEPTDFt34+4cUhDyr0xC7sz 0jGqwb8TbuMRYw+wwPldQhhJdIaW7VtA8Xqo1+8d6HAVkGcZWHW6SNRgqDlET1eNvyOr 9fzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682996466; x=1685588466; 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=Z8+VX4iFUOOuDAJt+noS7zgRzfcMEdZ5w8Wf3gUNnn8=; b=Dt9kN+l8kgKJHz5zDoAnoNEMgFI94fQ/DkDZTcJ66bBBf+GQuwIGM0RZ7r0z6HaTMO aNiYlZVqCMjm02RcvXMaqvaXO4Nv209K+HdjFClSAsqSnbfv88mnVA4dfW+JiMthXLg9 KtQDJqgB3fsZcg1jmD1xxYsVXYnJLlHkAt5CLfSucDD96V8KbdFUvQSZM8F1e3dzjCmE /CtX0+NZif3Mxlyk34jEZ8olD2TJFoKt4c4542brKgNm0mQlR0i3mDl7oDJo4nC906Mz kQqS3VsgkfEjE0RLiFKhMnbew8au9QGht2EG86NwK0p6SA22sZ4BDKtrffPq54j8ufcr ysLA== X-Gm-Message-State: AC+VfDwnf4YxFC3glQkkEkDdmv6JzuNAOtNDz+h4vX9lvbvqGhEbt2ds weCUW96YiR9+ulCKowFiZfMy7JBoigw0bimTd6g= X-Google-Smtp-Source: ACHHUZ5aCEwv6Q3AbmEV6RgB86eki6pAxEdBnwSDMao24cRBllytCPJJcMMeAIzadfrdWXgLGcBzdx0hu2GF67u0TtQ= X-Received: by 2002:adf:eb92:0:b0:306:389c:1620 with SMTP id t18-20020adfeb92000000b00306389c1620mr153885wrn.55.1682996466394; Mon, 01 May 2023 20:01:06 -0700 (PDT) MIME-Version: 1.0 References: <3032112.1679865718@sss.pgh.pa.us> In-Reply-To: From: shveta malik Date: Tue, 2 May 2023 08:30:51 +0530 Message-ID: Subject: Re: Support logical replication of DDLs To: Amit Kapila Cc: "Zhijie Hou (Fujitsu)" , vignesh C , 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 , shveta malik 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 Fri, Apr 28, 2023 at 5:11=E2=80=AFPM Amit Kapila wrote: > > On Tue, Apr 25, 2023 at 9:28=E2=80=AFAM Zhijie Hou (Fujitsu) > wrote: > > > > I have a few high-level comments on the deparsing approach used in the > patch. As per my understanding, we first build an ObjTree from the DDL > command, then convert the ObjTree to Jsonb which is then converted to > a JSON string. Now, in the consecutive patch, via publication event > triggers, we get the JSON string via the conversions mentioned, WAL > log it, which then walsender will send to the subscriber, which will > convert the JSON string back to the DDL command and execute it. > > Now, I think we can try to eliminate this entire ObjTree machinery and > directly from the JSON blob during deparsing. We have previously also > discussed this in an email chain at [1]. I think now the functionality > of JSONB has also been improved and we should investigate whether it > is feasible to directly use JSONB APIs to form the required blob. +1. I will investigate this and will share my findings. thanks Shveta