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 1ncmt8-0001sq-Q0 for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Apr 2022 11:34:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncmt7-0007Xg-Jc for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Apr 2022 11:34:49 +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 1ncmt6-0007XO-NE for pgsql-hackers@lists.postgresql.org; Fri, 08 Apr 2022 11:34:49 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncmt2-0005vY-BR for pgsql-hackers@lists.postgresql.org; Fri, 08 Apr 2022 11:34:48 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id BA6AF32020C1; Fri, 8 Apr 2022 07:34:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 08 Apr 2022 07:34:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date: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= fm3; bh=F74LqxDzg2hB6LH1wpNY6Wzxg5WXkNQoQpMNIJnZIQE=; b=A6vAdlPX t/9t7YCqpyp/1Cweyhpp7Ypu8cUm8SRi+Fjf1dneBusdzaZ7YGciPQwvewWDgOz2 9k/fLAT44SVclq2E8/H9HVdkzXbaSyl1nHashHMNZRfvg7DeFSuakNyDVKsaFyBh B+2STGZB1d1mzJIZDD/BheYYT8TlrMIPDbKgReB2aNVy/HkZx4c3apdEf7d5RrzU EOHIhhlOzilyvKRPDf8YzA+1n2qfonMkl2ezocO03IVafBbR3/UEpLdSYFkJnDV7 uI/RofhcPEgdZCow28WnQIyrIsNfkxZ93mzDoOIbRYnCaJaAWQV75+bQ+sl6ertr tx/E+t9V4526UQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudektddggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeelfeekhffgleetieegjeekvdejvdelhfeuheefvdejheeu teevteejkeeufffgheenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpdgvnh htvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Apr 2022 07:34:40 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 580902A0A36; Fri, 8 Apr 2022 07:34:37 -0400 (-04) Date: Fri, 8 Apr 2022 13:34:37 +0200 From: Alvaro Herrera To: Amit Kapila Cc: Zheng Li , Dilip Kumar , PostgreSQL Hackers , rajesh.rs0541@gmail.com Subject: Re: Support logical replication of DDLs Message-ID: <202204081134.6tcmf5cxl3sz@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 On 2022-Apr-08, Amit Kapila wrote: > On Thu, Mar 17, 2022 at 3:36 AM Alvaro Herrera wrote: > > > > 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; > > I have read that thread and found one of your emails [1] where you > seem to be saying that JSON representation is not required for BDR. > Will in some way going via JSON blob way make this project > easier/better? I don't know if replication support will be easier by using JSON; I just think that JSON makes the overall feature more easily usable for other purposes. I am not familiar with BDR replication nowadays. > For runtime conditions, one of the things you have mentioned in that > thread is to add schema name in the statement at the required places > which this patch deals with in a different way by explicitly sending > it along with the DDL statement. Hmm, ok. The point of the JSON-blob route is that the publisher sends a command representation that can be parsed/processed/transformed arbitrarily by the subscriber using generic rules; it should be trivial to use a JSON tool to change schema A to schema B in any arbitrary DDL command, and produce another working DDL command without having to know how to write that command specifically. So if I have a rule that "schema A there is schema B here", all DDL commands can be replayed with no further coding (without having to rely on getting the run-time search_path correct.) -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "El sudor es la mejor cura para un pensamiento enfermo" (Bardia)