Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wIJGS-007y4t-17 for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Apr 2026 04:44:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wIJGQ-005uT9-13 for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Apr 2026 04:44:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wIJGP-005uT1-2y for pgsql-hackers@lists.postgresql.org; Thu, 30 Apr 2026 04:44:38 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wIJGL-00000003vKL-1xw7 for pgsql-hackers@lists.postgresql.org; Thu, 30 Apr 2026 04:44:37 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-5a74ac8b40aso500151e87.1 for ; Wed, 29 Apr 2026 21:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777524267; cv=none; d=google.com; s=arc-20240605; b=gNzMWOZEw+kSPkUv+D8Q2aB8UqqiSQ7YWEGZQ9VUcfUpFBHnp4a7xZ8j/D5MdRB2rG 1x+BkJzc2p04HXRwp140gNgOTvpAX+ouTzjNB7spzAYWLSXYcQJLDee7wwaAOCCdyt3E SCmfH9C2B+BCUSDKPDsFv7jhzerurHmGD9ENlCb+r67xNNeZjde5i5ctxP2s1TjtEV7f MsMAKIULI0L3SJYQIwqq4O46ah9FmBvj+VMVm9cZwYYRTp3x8xzEtPa/iqxM2ngIDj6T 8H4y9Iv2uuyRFjOFdM69XHUIVMPY7gIe3jbd0tTGt9zX5JdNErQNmW0eiaY8Fbz0E9Gm pn5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=c7Zm3ul2RCPanuXvnvb8RZouu9/iZR9xTcOCMVwHASA=; fh=bVQDzrgIvga6pK6PftYIL015pNU5+AK1N/JqBfRkwyY=; b=NFz15+ejEWSCgAMJ9taJMdGvxNmh7axAcZ3YQLMnkQU0GlKPvcHcvZPUz0YIXxf9Cr Xug5b/dH7kN09gKnnJ8tZrm809lWAyQpLzonVLpZLyQGtkWLOFLNOOfHL9eGCQC7e/P5 41IU/VHHyMCsCGYIAQZJ7KZegl04Ei2htZ22I6WjUPfNhiYQTXiDKynarWtlXTerjV+N Wylbsg0WDQfTEpw7dY7Y+Zg14rsg3Ve7VwAni4jpDD/mKXd6XrmUsqiY31kh33J8QQE5 xViliLxw0nOPr+3EX5o5ja2VTMTc4Gff6uZ4ERslImf077Ae+ir+VzE+8ANRYPHVQIwl OOqw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777524267; x=1778129067; darn=lists.postgresql.org; 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=c7Zm3ul2RCPanuXvnvb8RZouu9/iZR9xTcOCMVwHASA=; b=gHFk1LsQEtXRUY9wYuE95O6NSyBD3vTAoJl464GWtotck8Uwqzhtkj3SqnrlkaRS3R wFWpn9VajrQb8bAwprOE4sh4sDAYxd34OkKTG5vhQ9tAxvDXccaQZeBO+yivv+eZn+0/ JFfGyC/0LMAEF7ToKDhPabSgYIFmrjzAyF4lhgvNbMPysX57DfTsFpjXpsdsHi+N2Uds 2g35ZcRohxKaAKUPb1yW3VB1a4TvH7GRcf1EHrtKsD75EZXcNymjHnt5My3kJv159O/n Spx1ULIeB94CdJz751ajzXg1nzvDHjhxF9P2Meii1n3B8OS1MC/6G8yNHUI3WGl7FC2l 2Rjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777524267; x=1778129067; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=c7Zm3ul2RCPanuXvnvb8RZouu9/iZR9xTcOCMVwHASA=; b=shrGE0JRMtiHgc5hN4/X4Kfi9djM0M+bHyj+cKgsasx07ppZ3mHxhFkrZ4BoByrBVf FpNOgu8PW5o8eLIdY6jvjBFOAbupT2aHVBZ+euZ4N5HSUXo4VgXleaa1ufuROYi3m8GK 1Dg2Eqoy9eWvX6I7eOyQ5ZWB+qCR7ooSA5SDeIl9FRa1GqFYoDO05axAMSYcR+Htt4N/ /Cftv6prFBuwpSX/gklqmrPGXQyTr42cLASl3BYUGgfOVwxHRHa/6SAulroEaedjuNkB XrHRa+GOp6LW82JilDyBsZATCaNks6/11sqQom07bGw5IFR6W7RLn6Rao8fFvD134YHb vE/w== X-Forwarded-Encrypted: i=1; AFNElJ/VnfdXyNjmzHZoeUXjQUUfl/FT6/BtaB/hmv2N7JZlSaiWSv3hqSI7i+Y/TmusOwMwdzWOS0+94U53sOmG@lists.postgresql.org X-Gm-Message-State: AOJu0YzK+WXW90iY9km5wFcvdiVs1WIHz6+R/i0Mzl2Pvsic9C0QY5nI 8YZMjZ7jJMhk6EiNnAMlRLVWZp+BHVsVGYqCagewy4lszaN7fCeecMA+J5Rc/mYNJcrQBUxuEni ymPWwFRtu3tLKRNI6D1hPkncJ8CwLqMI= X-Gm-Gg: AeBDiet7uXx9r+ULsl4y4IaD4BLiDxzVtdoG00GuUNmQTIGCNmgsZ1sf6RiENeH+nN/ sH9KFPVwdTwmUS16Fv+2c/PxMbvxdHLCKk/Jh6TOSGnIKyMabfi1Ch1Zb26WAr7zPP7e3klDolN 3jSTVk9bcr0n1rNtcU2gedJAhRnIZHlLgncKsbzBuc7oSv9GaU1E/eMwl16iqatKIaYK324RUgw TCYExpA+qhyMu49uUyy5RN2JcO+9b1ONTW2PmxbJ1oLbhJz2yNH/IdhqiZMR7VKwloiYa5/Zh8W e8l/6U7fOlVrMFVSED5GiurIf+UO2X15DJP/q4Nt0wmnt3+mamR5 X-Received: by 2002:a05:6512:3b14:b0:5a4:a4c:658b with SMTP id 2adb3069b0e04-5a8522dd8f1mr298249e87.40.1777524266962; Wed, 29 Apr 2026 21:44:26 -0700 (PDT) MIME-Version: 1.0 References: <080f9394-c127-4cef-865e-10f2f997125c@postgrespro.ru> <38690b0e-f91b-46fa-b72a-57775612e463@postgrespro.ru> In-Reply-To: From: Amit Kapila Date: Thu, 30 Apr 2026 10:14:14 +0530 X-Gm-Features: AVHnY4KVaCF7buMW3u3dAXns2E2OcKXv3LcG4XfSh24gTtbYSrni6jpjtZ8OeWs Message-ID: Subject: Re: Support logical replication of DDLs, take2 To: Masahiko Sawada Cc: Vitaly Davydov , Ashutosh Bapat , 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 Wed, Apr 29, 2026 at 3:19=E2=80=AFAM Masahiko Sawada wrote: > > On Mon, Apr 27, 2026 at 11:32=E2=80=AFPM Amit Kapila wrote: > > > > Yes, there will be a maintenance cost of JSON-based deparsing > > approach. But note that multiple senior people (Alvaro Herrera, Robert > > Haas) [1] seems to favor that approach. So, I am not sure we can > > conclude to abandon that approach without those people or some other > > senior people agreeing to abandon it. To be clear, I am not against > > considering a new/different approach for DDL replication but just that > > it is not clear that old/existing approach can be ruled out without > > more discussion on it, > > Thank you for pointing it out. Just to be clear, IIUC what they liked > was to use JSON string representation of DDLs, but not JSON string > representation of DDLs that are deparsed from parse nodes, no? > As per my understanding, we built deparsing stuff with a goal of supporting DDL replication and Alvaro was the original author of that work, see [1]. The benefit it provides flexibility in terms of filtering by decoding plugin, if any, or changing the DDL (like schema-mapping) during apply. It is not clear to me if we can achive similar level of flexibility with other approach. > > > > > We would need to maintain the JSON serialization code whenever > > > creating or modifying parse nodes, regardless of whether the changes > > > were related to DDL replication. IIUC, this was the primary reason th= e > > > feature didn't cross the finish line. > > > > > > Additionally, I think there is another design issue: it is not > > > output-plugin agnostic. Since the deparsed DDL was written by a > > > logical-replication-specific event trigger, third-party logical > > > decoding plugins cannot easily detect DDL events. > > > > > > > Why RmgrId like RM_LOGICALDDLMSG_ID and XLOG_LOGICAL_DDL_MESSAGE wal > > info is not sufficient for this? Decoder will add a message like > > REORDER_BUFFER_CHANGE_DDL which can be used to detect DDL message, no? > > Right, but I'm not sure this is a good developer experience that > additional steps are required to capture DDL events for other plugins > while changes of INSERT/UPDATE/DELETE/TRUNCATE are passed from the > logical decoding by default. > Yes, there could probably be additional steps for plugins but they must be doing a few things already which are defined at publication level like column lists, row filtering, something related to RI, etc. To reduce the plugin work, one naive idea is to let the event triggers be registered at first logical slot creation or may be at init time of plugin. [1]: https://www.postgresql.org/message-id/202203162206.7spggyktx63e%40alvh= erre.pgsql --=20 With Regards, Amit Kapila.