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 1vrvJK-00D86E-2D for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 09:54:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vrvJJ-000coK-1V for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 09:54:33 +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 1vrvJJ-000coB-0S for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 09:54:33 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vrvJG-00000000zjX-3RXa for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 09:54:32 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-385c2f88618so22824021fa.2 for ; Mon, 16 Feb 2026 01:54:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771235669; cv=none; d=google.com; s=arc-20240605; b=Lb9cyakuRRCoav8Nrwwjm4ZSYfBGjLRRt4KKV5osJUwZvC3sE1eBr+T3D0d/Kmqx+J grV8i9Mk74xgKGtjxKR58okORlwMZO1DrN5gy7Cz/WW3nnhuZmDySMh69D9L1AMipm6w 5OEXOgQOHU6i5l52dDIMNKG30KePNRgUPFevDDj0a0QrFZMJ9kmRHPqErTIbVVjyIKYp +IC6FXbamiFk9O14QZh3l8nhg5E4EoiMWW9qfDjTHPYHqBRaFoxmM3/vJ5ZEcI1D733g OhjaRkrG/7KNaPu5ogOxMF93Eowm0xTfIhcmgVfotCZdOXIYaieTb7oKa87Mva1fpbdz 0oJQ== 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=TeR6vzGticTfuLeJuyoLaQInkpSzp39qGVLLdwQAaTU=; fh=fBSZVYC5rzeJFvoPuncJ+izvpzWXBuP9hLAvU5ez1AI=; b=QJMpitOu7InPi0Wm0N/BypK4jqxssgNBL4w0dJZ/P6c7+S3xLkoKo01J6mXhFsTuRl qnCQy6Y6gVOLyKqdPE9Hlux1E18YNLMqIhfGwBnBBJqKK6/NClGnPaO9y4Oc0YsIN0x4 T7BZ3S08OHqN6x/M6ZB2mMe18RhO9i205QSxHNXvp0U5waH3WfzmF14jOG1aosDADC6x n8wmobaMwexEmzE9h2VB0Am09ya6bal8atl/Jnx2Jwx2Xv4cs0vktMmkJKHNR60Ifa97 RzI9jIz/hM4QVfWfduRryRArkUkNZQ40x04N0O/SN91N30GUB+Lyus5uvTxut0wOfy/i UWmA==; 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=20230601; t=1771235669; x=1771840469; 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=TeR6vzGticTfuLeJuyoLaQInkpSzp39qGVLLdwQAaTU=; b=hRpF3beOzggj0QnXSh6Ua1E9qGUR4o19JThi1ifh/oLdVpTvaj7XKzJiTB1O/HUklf YpuqqcBntvlo66mpI/hu4i2rezX5BidQwRPaVUvB3YjNDz2xNzMmW5QKCtXxfMIoeij3 y6Z20RhNzKMg3S65YhR5XIuiimtuctrxkmNNMI5zQQIkqCxcX798B03xHjlhnnSNQ3l+ OcpD6QV4ubTAczIWcrWbLfixsQuEuH41ePcwAK55mrlgeWmVeVpf5gyeT8rL5HrGEix2 lrKD2kUtlrkokm0oPcyEiHr0gvNZCAIl5h97JG/cX7cnCLbQS4t+Fp3qOxFznhHd6MVQ aPsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771235669; x=1771840469; 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=TeR6vzGticTfuLeJuyoLaQInkpSzp39qGVLLdwQAaTU=; b=dCAJBNOh8eDqv9kIik4i/lK6ThOYe9G90lJb8p89haaBsrWkYtQkoPlTIgL5xJidYD Uc/mvySfAmMP4Iehjif9vuKOg/UoFsIRK1qu5JVVwUREgnLUkbouqBHmNUUnU1cfCFF9 U2zbmSk0lsvcYvRIdKODth5qDjdOJDG7pgsvS3eI3oU73p3DQ4YukW3U3DfS35ihHkTo sIzsIHxWO69gTtbuswCxGWh/YS6/9SfHSWdMTQi8jNVJpfjCrb42wDBaM81F34ZwzMkH pN9+BrAxxth+giC4TgC+SPI1lvpbkhKYxH+7BiZ+rgUW2KuDrg+0ipwo70oi/Y0wRaJn oNTw== X-Forwarded-Encrypted: i=1; AJvYcCWRYTbrD8Kv5QHxpUUle2mgzFTXSEDLGgGTRydZBosG4zKZHZt/MduaFhlTcrV7lHUtJOqrAho/ZMhFIZLS@lists.postgresql.org X-Gm-Message-State: AOJu0YyPYnJxIUOADT7boIQPj7XItAOiQB2bqi0xzqE/qjzhsW4o4a2O mhFT2ILFgZ6vPVTBX1N5CQYIM79g4MEOP/m487jTb04C3NJaSVUNs9PUPEcxbUk3v1uci4DEAWT /8jDEtnkUHGg+2wqhTvVhrDPIJO3oFas= X-Gm-Gg: AZuq6aJ3U8WB6SdQ1+CREVr5vHQKSqXnyfsLnQmLz6IIsyObfHjuNlxzXMDzUxqBsFf HXUnU+K/O+CIycEjs4OSiMsstsq2//58yr7xavYm2KO8+P5CHT7olaJ18utuvMpLTW0NqeA2ISq UemJCXLH1Ls7UttlmH4S8j3/bflqdd1DlMWLaFmu3H5m6Yb+FeqW+ryN1tDJNHGWQQqzrQ0DOKy VCDNP0Dyp6YsZggkFL1CnciP27jOYTFc3bV5Q2wI3mAfv+ivFilDIyfPJ1cYyblBWbeVvYBRVuI m1rZO7dCs1sLikem3oGhVDOwkvzRrtziTF2tCb0UNi7lnUF/YaBtq1gNXhkLsro4ydyPH7QISg= = X-Received: by 2002:a2e:bc0c:0:b0:387:384:923e with SMTP id 38308e7fff4ca-388106c093amr33181421fa.37.1771235669046; Mon, 16 Feb 2026 01:54:29 -0800 (PST) MIME-Version: 1.0 References: <080f9394-c127-4cef-865e-10f2f997125c@postgrespro.ru> In-Reply-To: From: Amit Kapila Date: Mon, 16 Feb 2026 15:24:16 +0530 X-Gm-Features: AaiRm537yOY4LIYNI9Ci-JOcvjnZyxeNeCDhfRXhfk6yPfUtqllw6OYwNK4KPR8 Message-ID: Subject: Re: Support logical replication of DDLs To: Bruce Momjian Cc: Masahiko Sawada , Vitaly Davydov , pgsql-hackers@lists.postgresql.org 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 Fri, Feb 13, 2026 at 3:42=E2=80=AFAM Bruce Momjian wr= ote: > > On Wed, Feb 4, 2026 at 04:39:38PM +0900, Masahiko Sawada wrote: > > On Tue, Feb 3, 2026 at 1:04=E2=80=AFAM Vitaly Davydov wrote: > > > 4. Another option is to create json/ddl-sql from system catalog chang= es without > > > an intermediate representation, but, anyway, when we interpret system= catalog > > > changes we have to temporary save current data in some structures. Pa= rsenodes > > > is the already existing solution for it. > > > > IIUC, one of the main challenges of the "deparsing DDL parse tree" > > idea is the maintenance burden. If we implement logic to deparse parse > > nodes back to SQL text, we would end up updating that deparsing code > > every time the underlying parse node definition changes (which happens > > frequently in internal structures). This introduces a substantial and > > ongoing maintenance cost. > > I agree maintenance is the big blocker, but the maintenance is two > parts: > > 1. writing the patch to adjust for new features in each major release > 2. testing the patch > > People create some strange database schemas, so testing will be > difficult. > > pg_upgrade had a similar challenge, and I found that pushing as much of > the changes _out_ of pg_upgrade and to other parts of the system, e.g,, > pg_dump, was a big help. I am not sure if that is possible for > replicated DDL, but if it is, I would pursue it. > The other reason to pursue a deparsing approach is to allow "Schema and Object Redirection" between source and target. For example, users may want to redirect operations from a source object (e.g., HR.ACCOUNTS on the source) to a different target object (e.g., HR_BACKUP.ACCT on the target). Many people in the past supported such flexibility in DDL replication which is one of the reasons we pursued a deparsing approach in the past though that project/approach is paused for the time being. I admit that there were many unresolved challenges apart from the maintenance part of that approach. Personally, I think it is better to first finish initial sync of DDLs as previously proposed in thread [1]. That part is independently useful and would be a good base step for the incremental replication as discussed here. For example, users don't need to worry whether their ALTER's will be replicated without an ERROR. OTOH, initial sync of schema prevents users from snapshot related problems during initial data transfer during set up of subscriber. Now, users need to use pg_dump/restore kind of functionality to do initial setup between publisher and subscriber then start replication. If there are more DDLs ini-between those steps then the initial copy may turn out to be not useful. Additionally, initial sync could be useful in a number of other cases: (a) Many times one needs a clone of the production schema to run tests against, (b) Sometimes users want to run heavy, complex reporting queries without slowing down the main application. So, one can clone required tables and start such reporting queries, (c) In cases like (b), many times, users may not want incremental sync that drops the index as it could be required for reporting purposes. [1]: https://www.postgresql.org/message-id/db02e6773adb4dbcb5b9bb3803ebe340= %40amazon.com --=20 With Regards, Amit Kapila.