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 1wHcO3-007M9r-0m for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Apr 2026 06:57:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wHcO2-00GZno-01 for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Apr 2026 06:57: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 1wHcO1-00GZnf-2J for pgsql-hackers@lists.postgresql.org; Tue, 28 Apr 2026 06:57:37 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wHcNz-00000003U2w-1SmY for pgsql-hackers@lists.postgresql.org; Tue, 28 Apr 2026 06:57:37 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5a3d1561e38so9074619e87.0 for ; Mon, 27 Apr 2026 23:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777359449; cv=none; d=google.com; s=arc-20240605; b=JX/WQ2HyikI+apa+nU94sMOdRbtNf0HyDIzpyLyfgJbj6e2zIf7gWZuR794f5Sr+py k7szAv1imNpT2/0qfptrCb7jf82oGVe/OZichoZjQ2ApIdARb9If9XVXL4fCnKGQ8zC6 L8FqFjNgZuhpUvLRdUX4Xs+iVwkopcn30Kq6geX7gYSCrzIymVeRZsbdd9Z2Ozwa+5lr tzALOccXmnvxe6x6I3QGi7JOoMvQDOCPN+AsYXBGYDrhvhaZNjP8teR8/7f2/CqXHZVi Y782V7utWLM05E3l8Cba2dOGctlBTnvHIf1MMX9BR+pJ1AuOdwRH1jzlaVpzzmcLVeG6 rM9Q== 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=YK7/GOmogvNJ7AgzOBnH7nVZB4tNN9VNAdS/P8xVU0M=; fh=k3TdPcLZC2t2Ktm1RcohyTOol8s1xPMIboOevwjO2+A=; b=QkdzHyYKrHIP01eXA4cHN30THk3Txe0bBWxurrcmlq4MEpHYRWSJGlec7MEgSJaodh OLgscTXxr0KqJAYt0m6y7Q19Iih1wt4WtuK7HzM2YON+XiUu7e56DKoiWe42dGuVTmLv iH2c6AW6WkRivUDP2wqDQVGbnH7OXqqMkPN+ih4PijjYVSKB1cHLHaAz0SEVRzLw1QOj 8wKyQAHHo3x5u0QlEfWMHwrVwjSgYzGtaUEYV47dRwu/4Deu7jw1LWwSa/iBmrqS9jRu 4J+EAojn6aJ5UVJoHZVuxriSWSxFGYBM2pMxOM6CDE+loY7sVRxRUijy9XgP+nMmaTNm 9KtQ==; 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=1777359449; x=1777964249; 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=YK7/GOmogvNJ7AgzOBnH7nVZB4tNN9VNAdS/P8xVU0M=; b=k5XOtC0mzCFvGC7vCZXtH/dPZXBG0+s6a2iYZQnSosAWW+ifE6XTR38Ecd0uizXgXE c7P+00DSc8SyhYdaaEe1kNOib7OL7qAEh5QzRV7ThW7wx4+3nlYYSNMOPF+qv+Et9wkT bab8pH5PkiU6iSR6kQKdiVVqCOarGT14N+kb9lhQB65wJkkNiKFbmSKT+PgRRgDKK2YY +Cqg9+ZvpsHHWMzIkIt3xSmna40mRDGtLmY2bDL3owIybp5FnZQiH0Rg77yZP/YtR5/C dWIXOFqriq5xn6eFFWrd48SZmdOxORdWsR7opihXQa3didSkIUnlzyaR5P7hjexSzsLL GZ4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777359449; x=1777964249; 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=YK7/GOmogvNJ7AgzOBnH7nVZB4tNN9VNAdS/P8xVU0M=; b=cYPA6gvfWKfBM+njjhEqzDRVYTGFSGWus0ap7MCT9w0oB41y70A6UgRFn+9QY01ZGc L35IdsN9svzi571uVee5NaCk73OmQHcRxITjKAdj/+UNfAbm/sFmyhd9vRHzBQ+x36ui CssX9w3w+sQ7L0JR0oGkJY2IILI6jR9vvs8hBufU7AOXYb4/a0G96h9iAN4zxo1uSlpF WNeK8EZZnqPiVyu5tRYM1okj8WiooPasceySlwGGG2XS/HE2ld4DR2/hxyEyCVCuk+88 RAO8+/TJOL4EmxRPROGblH7//DcSsIYGFDtpsBHgE5tapjw8Xk+cTxeZfUGumvp1tHoj wQvw== X-Forwarded-Encrypted: i=1; AFNElJ/XPM5f3svNRxs7oR4/aIOpbFUBWBya/dTf15hwlnFJT9LRyqrWqE50QgzNKcN9hRvW09VcefqNRX3hK9/y@lists.postgresql.org X-Gm-Message-State: AOJu0YyZG9H+ZjldYTJc4u3crk8nBUuxchnlZaM0ARLmNMMYWpHiO8mj Z1Wl33o2KPkOXXInn8evTHrpLGJpKFeIyOtj3fkoSezqE7xrnB4dhKqTQ7LSIWnxENjgAVMTCv8 WIO7QFBnkTNKD7kdYGqAP7UOAP/6JKvc= X-Gm-Gg: AeBDietRayKaJ7h9LG5zONal9HdvwMt8NZpSEdMVbeOjv7Zey4oSv5jrZCHON0k2gk4 OhMDXgRWUxAFL3DILK3RvGp8H4BE7gwlBwjNfIttHZN+nJdZt+LEdBL4ugUy1rTrDPDxlg+IIcP LeDDpNESDgBOWTW17+u1KEuynJKFVZodyZvwvuoyQEhrKtxTT1mychtK9P2o4t3mc6C3cIQSrWj 6DklR81VIFFBAfsURSquLAghtH1eZ8RXAurOsShY4SW39h0gQoEiUUWMRkpcPfqW+Upu4JgmLN8 uRQC8OQxzi5iJfF4RlgrYzMvQnqwXBxo/naoLqY4x+4WcswOD0ZwAQINjOHfXb/1qobo7ts3CEz y3RoebL0= X-Received: by 2002:a05:6512:6181:b0:5a4:496:5b9d with SMTP id 2adb3069b0e04-5a74661fe50mr830342e87.33.1777359449036; Mon, 27 Apr 2026 23:57:29 -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: Tue, 28 Apr 2026 12:27:17 +0530 X-Gm-Features: AVHnY4JzTENlwy44rAGIOoENENzIbC6WaoDk0520Dhtko7Jv-OQfrvwJKD4u1U8 Message-ID: Subject: Re: Support logical replication of DDLs, take2 To: Dilip Kumar Cc: Masahiko Sawada , 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 Mon, Apr 27, 2026 at 11:45=E2=80=AFAM Dilip Kumar wrote: > > On Tue, Apr 21, 2026 at 4:45=E2=80=AFAM Masahiko Sawada wrote: > > > > The overall idea of the previous patch set was to implement DDL > > deparsing and utilize it for DDL replication. It converted a parse > > tree into a JSON string. For instance, if a user executes "DROP TABLE > > t1", the deparser generates from its parse tree: > > > > {DROPSTMT :objects (("t1")) :removeType 41 :behavior 0 :missing_ok > > false :concurrent false} > > > > to: > > > > {"fmt": "DROP TABLE %{objidentity}s", "objidentity": "public.t1"} > > > > This JSON string is self-documenting, meaning someone who gets it can > > easily reconstruct the original DDL with schema-qualified object > > names. In a dedicated event trigger for logical replication, we > > deparsed the parse tree of a DDL, wrote it into a WAL record, and then > > the logical decoding processed it similarly to DML changes. > > I think there was also a discussion on whether to use JSON vs the > existing infrastructure of converting nodes to strings. Although the > JSON is standard format and might provide more flexibility using > existing format avoid extra maintence burden. > Yes, the discussion related to node-to-string and the pros and cons of the deparse approach are detailed in email [1]. I think some of these points could be also related to the new approach as well. [1] - https://www.postgresql.org/message-id/OS0PR01MB571684CBF660D05B63B441= 2C94AB9%40OS0PR01MB5716.jpnprd01.prod.outlook.com --=20 With Regards, Amit Kapila.