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 1wHvlu-007dQg-1A for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Apr 2026 03:39: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 1wHvlt-001gO3-12 for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Apr 2026 03:39: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 1wHvls-001gNu-3C for pgsql-hackers@lists.postgresql.org; Wed, 29 Apr 2026 03:39:33 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wHvlr-00000003h32-03Ar for pgsql-hackers@lists.postgresql.org; Wed, 29 Apr 2026 03:39:32 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-59e4a04f059so14990183e87.2 for ; Tue, 28 Apr 2026 20:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777433965; cv=none; d=google.com; s=arc-20240605; b=lhbClfv1/+c0UKw8TQHIf0k915qABHswPULAxxfJ0ppscwbZ7NGW13Dw9zdwJ6kA5u 5QwKDB+CKgEhsF75coN+Ccpw5rnQOsY9EdAAzTclaoZwGOF0wWwzsIFKwtDdQpx1gPb9 cCxKVpe1QKFJVVd3Hwc8d0O4L9dBmQf2ClPZpkeujIhtAw3ry5LQ6kV97IV2sjcnaSX9 BgC2Eh50Dg+3DS32Zk1eHdNabmMveXpb84MxKzyzOghBQPeR5Gp/7ThY+27VBk2iMDri uFvVkbwx/53HF3DUWxZYsLLpUpZBiuhsKtk9aGEhwHPX2makLmWT0IAI7N9juNWOoVmC k0Jw== 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=P0O0BMk0pe18IfTTGSuUWrcb3ej06QXwGn5gSH/LF9Q=; fh=bQRraMaolyicFevh2O1JqqjlQAQ2KAV0iVwv5nKOjpw=; b=c6nOdOwViQfQvBg4x3UPqVQ/Ehikkem2ii2SPjbo4hKps5enm6WGDhEJGPxJXs/Dmc 7CJSVchxwTnVDgMspaUFJP6FZPK71pprJU+lq2WTQtvEijJeuHLKbNYWKc11hNaerWCC C7b+MlBOZSKJYoUZ3b9aeUDrYtEDmLJqo6qbI43djR1v4M65LJKpjzNNy8xPLdsp5APA psxWwkqlX6+DEbt9kWv+u32bX1Ck2+YGErdejcNkuin70pWaxB9SOndQxAhrx/7uuhef 22ockXBPCCekBP4JsCE0WuUk5aYNCT4MhLOr1+t8bIDnvACY8oYv7V6c42/LpXCPwmAH KiNw==; 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=1777433965; x=1778038765; 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=P0O0BMk0pe18IfTTGSuUWrcb3ej06QXwGn5gSH/LF9Q=; b=cQHsbbpo8sFmF6+dV+CpxgvPMpAvUA8ta0/0pxDJm7RZ+IGl0EGYPuLPfjbZ/YW8EH ghsCRpg3DVBJwPJHlRVkpmc8tt62ysLw9KkydH5pIrDTKbvv8sBp6clTCqVYHGYmQOtv KSXicc/HL6Ln80cVidDD/I6pZ3awz4jav+/1Z2RPqzaKh1XV/cbgI5CImfLBYX+Jhza7 T8yLN4RTdn+Q9XWmtG/pRwYkQ+NbQ23U8DhB9r6BlCYB3UwELj1k2X0xgVQk3Yq800NB 16F0PjiLK5c87ffekdFrIV/yIoEoTVHGtmnRY2WHSn0iWGc0iXag6mPZ0v05nck7rEQc wBEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777433965; x=1778038765; 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=P0O0BMk0pe18IfTTGSuUWrcb3ej06QXwGn5gSH/LF9Q=; b=M90jsrGVxEE5DXRlwOSKuPJdGdKD0i0k4Mb+XjX+W6YedSAOoHmGtT7RJ6aYPstPH1 FQnCobWGlgWOWnFRCxCsVC8R0HpPCnC+FaloiOQO9R5yHvoA3DawU1yBWmgh/SzNv5z/ a24BeSVXrZwaqRqrtaoMWs/QKDrdC7EEmPbwrQbYyMt76bbPPf9Okrmenam801SPHz8S R7/DXmNFHV5QQEdLNTYnxTo3+PNzfCnp45A3vMHEV8oxQYP0jbFzAvwQ0i3xze++Avxi WRPdVgqDmyWv7gxQmBBARnp2NGyClhalSgjPKQNYb6k2UCnuYnYPDLEAMabkoc2KQq1n +yaQ== X-Forwarded-Encrypted: i=1; AFNElJ8WCB98x2aW4Gd8ATveLExmgwn0blNNohpnxKhfnjvLk1Wl3LyeuKJRt7K6HpWh0t501Q3HgsNUpzGp20AS@lists.postgresql.org X-Gm-Message-State: AOJu0YxDMO2HcOTNcxOJI1rJtvj4VfgYZ/iEhwelx0Qrlt1pWP0i8L/V m3F/2GCIc+KJMJXlO0d7Hxhy1XjaWNPm5ZrslU2K2F3hOVxbStBilBOZu8FAoPUz6GTrDzKAAS/ Aqv+Gk38yoQRRL3DbEi8/2ATafbtwh7I= X-Gm-Gg: AeBDiev34fFzhtgdfP9lLJmrmKYgk507F94ZnxNmE8dNBb90FeYAYdU6kOOwEgeLa3P U7qk7regcsaFxM+116ojMdkK8Yfwlae5qRTdZx9W1b2MhDBgYwTdCaTE8qXXx6zw9QErhNSRqgT 2EanFDTf+dQDlHAwUUk6oYF6Tl0lKrJsNQqbv/NBilxvIgwJtiEdCwQm5lpibW1zsFMKaffIWJY U7DTHfNj8/wYv/si7cwr8MWll/+0yRvSArxeQE50HLeP6ypsPGJ7nhFznuAkOjlePjMSkAZcKQl m5MT8sa4wYwe/ROlEQnAa+mWvVgi5txpGLWzjVh4lqQXCaBd4ZB+rGw/oBg= X-Received: by 2002:a05:6512:15a0:b0:5a3:ffed:8440 with SMTP id 2adb3069b0e04-5a7466098e4mr2011666e87.12.1777433965095; Tue, 28 Apr 2026 20:39:25 -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: Dilip Kumar Date: Wed, 29 Apr 2026 09:09:07 +0530 X-Gm-Features: AVHnY4KWzL63mc_P3DYS_5YLUHxO7pxf3ZiFayH5VnoHnGMSY7M1mT6bEDBccMA Message-ID: Subject: Re: Support logical replication of DDLs, take2 To: Hannu Krosing Cc: Amit Kapila , 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 Wed, Apr 29, 2026 at 1:25=E2=80=AFAM Hannu Krosing w= rote: > > My high-level understanding is, that we should first clearly answer these= two questions > > 1. What does Logical Decodng infrastructure make available to the decodin= g plugin call-backs > > 2. What the callbacks themselves do in case of DDL Yeah that makes sense, Hannu. > My answer to the 1. is "everything, as it should be the plugin that decid= es what it needs". It does not mean that we should always prepack everythin= g with special logical decoding structures, but there should be a way to ge= t at anything that is available in the WAL at least. The result is in WAL, = and for DDL it is also in the system tables themselves, in proper time-trav= el way. > > For 2. I would prefer to "deparse" the DDL from actual system tables at t= hat snapshot. In logical decoding the system tables are special in that we = keep the actual table content and have real time travel capabilities on the= m. This should allow us to use the code we already have in pg_dump for extr= acting the "status quo DDL" meaning the DDL for creating everything from sc= ratch. The main thing missing is DDL for ALTER and DROP which would need to= be added. But that too should be in the plugin, not in the DDL side . I am trying to understand your idea. If we are trying to deparse from an actual system table using a snapshot, why don't we just use the WAL? I mean, the WAL should contain the actual catalog modifications it has made. Although converting the catalog changes into a deparse representation of the DDL could be complex no? Another question is what we would do with those deparsed representations: will we convert them to SQL on the subscriber and execute, or do something else? --=20 Regards, Dilip Kumar Google