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 1nUsu0-0008OA-2A for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Mar 2022 16:23:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nUsty-0007el-Vj for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Mar 2022 16:23:02 +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 1nUsty-0007ec-Mj for pgsql-hackers@lists.postgresql.org; Thu, 17 Mar 2022 16:23:02 +0000 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nUstw-0002xG-5u for pgsql-hackers@lists.postgresql.org; Thu, 17 Mar 2022 16:23:02 +0000 Received: by mail-oo1-xc30.google.com with SMTP id q1-20020a4a7d41000000b003211b63eb7bso7018319ooe.6 for ; Thu, 17 Mar 2022 09:23:00 -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; bh=NSsUULm0fGD6kjFxSHGSh1ERM90taQwZPox+RvN6RxM=; b=WjZx4AXTg0zcqpTqv+ICZhd+gf9K0WuONqtpxToFtWGTJYvPQ0nQ7yXVFXrW1oHbbp sYi5JWowT3omny6ux8bkm3Qwyig95cNps41iYz3j6QPqnD935vhnlPfSKn5yY9aVClXl 06aRchYmxI7lpSZDtf8VDJWItTn1UqW268fYQYivW/AyiX+qcEitNNNm5YKKn3DGTyTN rIYwPmEiTuB81bGgg0QmllotbE/ZLjAW/Z8bZ8yoMY0PhC2uHUqbHV7p3yvxQxeGQe0F EKJW+CjJ7eZZl8AGgU8aUstAKp8yo2Pc9peyPmn84PIleWG+fvBLn2V53vdiTkaLi+fz oQFQ== 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; bh=NSsUULm0fGD6kjFxSHGSh1ERM90taQwZPox+RvN6RxM=; b=aGN0fFT3404/IuelXWyRw4Ek5pgUe0NPi7J+93PpWthpap/BL7dyJQwbVm/FO9QgzI cILyT73iBi5Bk86P4dpmim4UrIIRNaGak1v1Ri0OJOVqyVvqW6tQ47dVd1xYyqXY2F8A 3wu43WZb314S1TQUHtpF3lokJ2bs1pOdf276PC3otg/PTUReMwcFTOJf+D1dMkhYalJh /AW8PiPCYt2xAZ9u5uhP/VhFUSwOX1nEIDIhAOTz6cKHyXhbYp+lJ9bmrwvXCSW8HGT/ 0fLG+cV9h8jhDNm29jJelTsIH0GMiJbK1zrUt0lYaSXvSNt8mUlKv2l+42W5u9KM1bkg Zq+A== X-Gm-Message-State: AOAM532VWahuEdM5Cl9BSk2dDqLwQdZOe0NjLrgsSiwLaxMZsYzBlRdE 3ZntDISV8N7UeIsfbTZqk39wnd8z2c7NiawuSJQ= X-Google-Smtp-Source: ABdhPJyIafWuE8adVfdkPcwzU1tuJ+dSpZ1ZO0+TQ9B3SK+xcCtXwByqfO+UiTl9TsQviU74OtHCnOrgPJPFC4mx7Xs= X-Received: by 2002:a05:6870:e0ce:b0:dd:a4be:9264 with SMTP id a14-20020a056870e0ce00b000dda4be9264mr3483362oab.5.1647534177681; Thu, 17 Mar 2022 09:22:57 -0700 (PDT) MIME-Version: 1.0 References: <202203162206.7spggyktx63e@alvherre.pgsql> In-Reply-To: <202203162206.7spggyktx63e@alvherre.pgsql> From: Zheng Li Date: Thu, 17 Mar 2022 12:22:46 -0400 Message-ID: Subject: Re: Support logical replication of DDLs To: Alvaro Herrera , Japin Li Cc: Dilip Kumar , PostgreSQL Hackers , rajesh.rs0541@gmail.com Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Alvaro, > I think this is a pretty interesting and useful feature. > > Did you see some old code I wrote towards this goal? > https://www.postgresql.org/message-id/20150215044814.GL3391@alvh.no-ip.org > The intention was that DDL would produce some JSON blob that accurately > describes the DDL that was run; the caller can acquire that and use it > to produce working DDL that doesn't depend on runtime conditions. There > was lots of discussion on doing things this way. It was ultimately > abandoned, but I think it's valuable. Thanks for pointing this out. I'm looking into it. Hello Japin, >The new patch change the behavior of publication, when we drop a table >on publisher, the table also be dropped on subscriber, and this made the >regression testa failed, since the regression test will try to drop the >table on subscriber. >IMO, we can disable the DDLs replication by default, which makes the >regression test happy. Any thoughts? Good catch, I forgot to run the whole TAP test suite. I think for now we can simply disable DDL replication for the failing tests when creating publication: $node_publisher->safe_psql('postgres', "CREATE PUBLICATION tap_pub FOR ALL TABLES WITH (ddl='')"); I'll fix it in the next version of patch. I'll also work on breaking down the patch into smaller pieces for ease of review. Regards, Zheng