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 1p2tPx-0007g1-6d for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 12:20:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2tPv-0002R0-5F for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Dec 2022 12:20:51 +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 1p2tPu-0002Qo-SS for pgsql-hackers@lists.postgresql.org; Wed, 07 Dec 2022 12:20:50 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2tPs-00016s-7V for pgsql-hackers@lists.postgresql.org; Wed, 07 Dec 2022 12:20:49 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 7C5A832009A8; Wed, 7 Dec 2022 07:20:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 07 Dec 2022 07:20:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1670415645; x=1670502045; bh=/ vJn9+BKVspz5Q0pUsGoj+ADz3coRYFGgJ6CejetUAw=; b=NZZYuhNJt60taO5EF Nes/wy7H2QT4r7UtSfphOb/j2q0/8BYO3tB/oAdXkip+8+hzpuZ0ndW5SWIOVUvW NsFHnwrku+kk33qnZCDxvlYPjUgpkyQHmwC039e0iHxPALIB5as2i161bId7xWlr Uk3QEXBw8XDmHR+oJ1huRZeqhn42IiDTAhdi9u13ADbDOYlkrAvlou/o1oNqu4Ea IpC3nq46phhAG+snfICZ9GNegVs7OLwnYGXzTTiZPbrQIrzFdYMO+B4FRQ21U1G9 2czSY9Fa6Ya89LEfr5/uVLs9KJ8Ed1sERFv7qCE5vwycu6zgAecPRRfvollnqtRa jwuPA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudekgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Dec 2022 07:20:44 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 34DF9E98; Wed, 7 Dec 2022 13:20:41 +0100 (CET) Date: Wed, 7 Dec 2022 13:20:41 +0100 From: Alvaro Herrera To: vignesh C Cc: Zheng Li , Ajin Cherian , Dilip Kumar , "houzj.fnst@fujitsu.com" , Peter Smith , Amit Kapila , Masahiko Sawada , Japin Li , rajesh singarapu , PostgreSQL Hackers Subject: Re: Support logical replication of DDLs Message-ID: <20221207122041.hbfj4hen3ibhdzgn@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I think this patch is split badly. You have: 0001 an enormous patch including some required infrastructure, plus the DDL deparsing bits themselves. 0002 another enormous (though not as much) patch, this time for DDL replication using the above. 0003 a bugfix for 0001, which includes changes in both the infrastructure and the deparsing bits. 0004 test stuff for 0002. 0005 Another bugfix for 0001 0006 Another bugfix for 0001 As presented, I think it has very little chance of being reviewed usefully. A better way to go about this, I think, would be: 0001 - infrastructure bits to support the DDL deparsing parts (all these new functions in ruleutils.c, sequence.c, etc). That means, everything (?) that's currently in your 0001 except ddl_deparse.c and friends. Clearly there are several independent changes here; maybe it is possible to break it down even further. This patch or these patches should also include the parts of 0003, 0005, 0006 that require changes outside of ddl_deparse.c. I expect that this patch should be fairly small. 0002 - ddl_deparse.c and its very close friends. This should not have any impact on places such as ruleutils.c, sequence.c, etc. The parts of the bugfixes (0001, 0005, 0006) that touch this could should be merged here as well; there's no reason to have them as separate patches. Some test code should be here also, though it probably doesn't need to aim to be complete. This one is likely to be very large, but also self-contained. 0003 - ddlmessage.c and friends. I understand that DDL-messaging is supporting infrastructure for DDL replication; I think it should be its own patch. Probably include its own simple-ish test bits. Not a very large patch. 0004 - DDL replication proper, including 0004. Probably not a very large patch either, not sure. Some review comments, just skimming: - 0002 adds some functions to event_trigger.c, but that doesn't seem to be their place. Maybe some new file in src/backend/replication/logical would make more sense. - publication_deparse_ddl_command_end has a long strcmp() list; why? Maybe change things so that it compares some object type enum instead. - CreatePublication has a long list of command tags; is that good? Maybe it'd be better to annotate the list in cmdtaglist.h somehow. - The change in pg_dump's getPublications needs updated to 16. - Don't "git add" src/bin/pg_waldump/logicalddlmsgdesc.c, just update its Makefile and meson.build - I think psql's \dRp should not have the new column at the end. Maybe one of: + Name | Owner | DDL | All tables | Inserts | Updates | Deletes | Truncates | Via root + Name | Owner | All tables | DDL | Inserts | Updates | Deletes | Truncates | Via root + Name | Owner | All tables | Inserts | Updates | Deletes | Truncates | DDL | Via root (I would not add the "s" at the end of that column title, also). -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Las cosas son buenas o malas segun las hace nuestra opinión" (Lisias)