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 1nU0en-0006lJ-9q for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Mar 2022 06:27:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nU0el-00019D-SW for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Mar 2022 06:27:43 +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 1nU0el-000193-IC for pgsql-hackers@lists.postgresql.org; Tue, 15 Mar 2022 06:27:43 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nU0ej-0002O2-Dx for pgsql-hackers@lists.postgresql.org; Tue, 15 Mar 2022 06:27:43 +0000 Received: by mail-il1-x131.google.com with SMTP id x9so6073119ilc.3 for ; Mon, 14 Mar 2022 23:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XZtk8QlPpb6tAkLLK5mc3dZqnDSpnJSvvu7DF/W4jwU=; b=pxpBX8ovWiDQjB00TwMMf6RUyMU+czX/SQNf1bxQ7xaO9AYv9D0jjSYwuWNKF1US3n 3qpmkthqX0+ryGMtzD7XCW1Q5mvA9DNvf30tOPtwRRUdo8PbDg2dbB9w7YuFHXagR3sg tqKjFn5hSubWHIjCBbeJeXHCtTXxQP6NAhYx3iWCql6EC/meI3OM2bAUNNhB1JdkpF/C MXFbFq/a/6nvw5nKnZdjx97wFuY89mC0qV0ehNmsliZ+E+xOJs4xJJeP9m2f1d1brG8N YXquNpQUy1hRPM7vn8GTed8JPMmto9jGQGqFiWBBJeIYC9r6b2FoWK+Y9ETPjIjUibn8 WYbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XZtk8QlPpb6tAkLLK5mc3dZqnDSpnJSvvu7DF/W4jwU=; b=O4kg6DrHC3z3lD7hTYsc+RNXo/WkZBD1ufCCWHMgSGBfLmaSEQr67g2lRGC420io+j JYLRTUNB7sxqelZ8GDqPSIbtE8ApNjoCi+7nsvws+HvMeRNJSwC6Vm3+6EwcHpGPlCG2 1GtyUArcwCG6FjubGYFA20xSCVu2nCboEMiR45mR0ozNeW0JzUMEQJOeqPDG73c93BX3 oDoRVe8LCUTNo1JqFdoATPpySl7km+GRirbhNaOxgiaQuWHbTHAgRVtzEiw4fYuOglPK Oa2F3tDixOZlDfbK84ayq/oC7K1x/PJ8PtQGVLmaq5IjzxwBENOClvqThkIcSsX41mjr EELw== X-Gm-Message-State: AOAM532QFVNL0uPs5gUCJpxSbAdFdP632XoWjIZXQRpYDLHrPLsEndXI savqVHxmHakEk18cxw92Nn/fhaSug/a6iYIQ+gQ= X-Google-Smtp-Source: ABdhPJx/fHorWIgWEKAvjhzdggeyEA3WIGZDhb6xwbx8GPGYJRyJitIkrD69fHLMfOg85IDqZADaE6w3ZajTHxAOPaU= X-Received: by 2002:a05:6e02:1250:b0:2c7:b246:820 with SMTP id j16-20020a056e02125000b002c7b2460820mr2032455ilq.264.1647325659513; Mon, 14 Mar 2022 23:27:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: rajesh singarapu Date: Tue, 15 Mar 2022 11:57:28 +0530 Message-ID: Subject: Re: Support logical replication of DDLs To: Dilip Kumar Cc: Zheng Li , PostgreSQL Hackers 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 Sun, Mar 13, 2022 at 5:05 PM Dilip Kumar wrote: > > On Mon, Feb 21, 2022 at 9:43 PM Zheng Li wrote: > > > > Hello, > > > > One of the most frequently requested improvements from our customers > > is to reduce downtime associated with software updates (both major and > > minor versions). To do this, we have reviewed potential contributions t= o > > improving logical replication. > > > > I=E2=80=99m working on a patch to support logical replication of data > > definition language statements (DDLs). This is a useful feature when a > > database in logical replication has lots of tables, functions and > > other objects that change over time, such as in online cross major > > version upgrade. > > +1 +1 > > I put together a prototype that replicates DDLs using the generic > > messages for logical decoding. The idea is to log the candidate DDL > > string in ProcessUtilitySlow() using LogLogicalMessge() with a new > > flag in WAL record type xl_logical_message indicating it=E2=80=99s a DD= L > > message. The xl_logical_message record is decoded and sent to the > > subscriber via pgoutput. The logical replication worker process is > > dispatched for this new DDL message type and executes the command > > accordingly. > > If you don't mind, would you like to share the POC or the branch for this= work? I would love to try this patch out, would you like to share branch or POC ?