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 1wI3kG-007kmi-1s for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Apr 2026 12:10:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wI3kF-003LR6-1E for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Apr 2026 12:10:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wI3kE-003LQy-1O for pgsql-hackers@lists.postgresql.org; Wed, 29 Apr 2026 12:10:23 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wI3kC-00000003LGr-08LF for pgsql-hackers@lists.postgresql.org; Wed, 29 Apr 2026 12:10:21 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 26BCFEC0075; Wed, 29 Apr 2026 08:10:19 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 29 Apr 2026 08:10:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1777464619; x=1777551019; bh=DV2gjFG7G+D86T91LrEM9OLvz2Ji80FWFjywR6VU2lU=; b= sb3OogTCJrBKL69WekujP2RFO7a/yPF4QGRyltASzg5VUaXN/wL4y35k+ym0Bm8e +8RwE7zRFoHZvLQANXLOAaP+aM4TacnSGl6C0wyQD/4H8HmiBMYzdfW4Qm8unEnA xdgu9TF9FQXS1IQc62RgeW5UJxpoKopQ06gX87S48/JantHompgimv8dsYp0Ykqb YBgy05vnWe5O2yrf/FVEEGLZDN7Osa24uv0wavr1Pl8dvwciPjvjNvEC2X2VX3Q4 RDXOZjqMeK7zWloFS8daHjxFyXNlxgkLhqzv8ednw5X0dnJEFXNyqVKzF3vB4y+c aiXUJlwYupYZUDmqnybv4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1777464619; x= 1777551019; bh=DV2gjFG7G+D86T91LrEM9OLvz2Ji80FWFjywR6VU2lU=; b=E MoRKGjaKHYEqNA0jVN12O0jnKt+G3XmI/Z9qhNoYsdSPQn/kcd6ebCQRutaI0V5W 1bhkIUfR4zDXTE/jM1FrG3OWuHNnT2ESbxrMNcaUY739wwrmvxZCH5yB28WeV4QI i14mIz5fqI0cwm2sCGDK+qeEEmMdtYAOIeK0KstwFS2FSqmgbgJyGRW67guyxAGB pvEtnF7JhXJ4H3Gy+Ys99CmmmIA5Z5pWUwqQmKkKipFPxVI+L4vxbhm4+FYv54PJ ZKabHu4jX1pKymjqQhMlyg8ptOTm+A+PPNQPXyG4fGTbiUaE23/p7d+Qbni1Dcb5 iMCiPDp7xMT99fy2oVZtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdekgeegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtugfgjgestheksfdttddtjeenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnheptdelledvgfejvdffieeukeefueelfffhgeffhffgffekveeuheeihefhiefg hfdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeejpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegrmhhithdrkhgrphhilhgrudeisehgmhgrihhlrd gtohhmpdhrtghpthhtoheprghshhhuthhoshhhrdgsrghprghtrdhoshhssehgmhgrihhl rdgtohhmpdhrtghpthhtohepughilhhiphgsrghlrghuthesghhmrghilhdrtghomhdprh gtphhtthhopehsrgifrggurgdrmhhshhhksehgmhgrihhlrdgtohhmpdhrtghpthhtohep hhgrnhhnuhhksehgohhoghhlvgdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkh gvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehvrdgu rghvhiguohhvsehpohhsthhgrhgvshhprhhordhruh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 29 Apr 2026 08:10:18 -0400 (EDT) Date: Wed, 29 Apr 2026 08:10:17 -0400 From: Andres Freund To: Hannu Krosing Cc: Dilip Kumar , Amit Kapila , Masahiko Sawada , Vitaly Davydov , Ashutosh Bapat , PostgreSQL Hackers Subject: Re: Support logical replication of DDLs, take2 Message-ID: <2oh4o4zvj2jreituesxgglmnseo2m2brffms3lvao6mseemto6@32v67ejhxlht> References: <38690b0e-f91b-46fa-b72a-57775612e463@postgrespro.ru> 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 Hi, On 2026-04-29 10:07:04 +0200, Hannu Krosing wrote: > On Wed, Apr 29, 2026 at 5:39 AM Dilip Kumar wrote: > > > 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. > > We have the full data in the catalog and we would likely need catalog > queries for any change, even when de-parsing the tree. > > And we should not add the extra load on the original DDL side, just as > we don't for DML. That can't be a relevant cost compared to everything else. > At most we could just serialize the statement tree into the WAL, > though even that may be an overkill if we can get the change from > existing records. > > - insert new row in pg_class --> extract the CREATE TABLE (or INDEX, or ...) > - update row in pg_class or insert, update or delete a row in > pg_attribute --> extract ALTER TABLE > - except when it just updates relfilenod --> extract TRUNCATE > - delete row in pg_class --> DROP TABLE > - dml on pg_constraint --> ALTER TABLE > > ... etc That doesn't work in the general case, think of ALTER TABLE ... ALTER COLUMN ... TYPE foo USING (...) There's a big difference between USING(foo::int8) and USING (pg_size_bytes(foo)) but it's nowhere visible in the WAL. Greetings, Andres Freund