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 1vpRVU-008aW7-2H for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Feb 2026 13:40:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vpRVT-00Apex-27 for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Feb 2026 13:40:51 +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 1vpRVT-00Apeo-0e for pgsql-hackers@lists.postgresql.org; Mon, 09 Feb 2026 13:40:51 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vpRVP-00000001HS5-3adU for pgsql-hackers@lists.postgresql.org; Mon, 09 Feb 2026 13:40:50 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 126F4543876 for ; Mon, 09 Feb 2026 14:40:44 +0100 (CET) Received: from s899.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id EE14B545F7F; Mon, 09 Feb 2026 14:40:43 +0100 (CET) Received: from s474.loopia.se (unknown [172.22.191.6]) by s899.loopia.se (Postfix) with ESMTP id E89CF2C8BAC4; Mon, 09 Feb 2026 14:40:43 +0100 (CET) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s474.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=proxel.se Received: from s979.loopia.se ([172.22.191.6]) by s474.loopia.se (s474.loopia.se [172.22.190.14]) (amavisd-new, port 10024) with LMTP id FqQDr92FcC0S; Mon, 9 Feb 2026 14:40:43 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 158.174.129.34 Received: from [192.168.0.189] (h-158-174-129-34.NA.cust.bahnhof.se [158.174.129.34]) (Authenticated sender: andreas@proxel.se) by s979.loopia.se (Postfix) with ESMTPSA id 70C5C10BC4CB; Mon, 09 Feb 2026 14:40:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1770644443; bh=GwmaBRnFoe7m3nt2OZUtheicipluFa7mzhUVNEU9qMk=; h=Date:Subject:To:References:From:In-Reply-To; b=oqgrwMW6mGrDrch8YxxOzM8FHlyIGq84eXS99MRS3OnsyNIYlCPm8lY6uJWbBKNIQ BbvXAZ6liFGp0n4EOX9pjjK+ZDvZsQsDQuSG3HiTGz6zUbd5FubCO2G+XLBqWLdz+3 W+MgiIok8uZtKl4i5Nr0EkUsqGQMg14litWpDUXps7Fz1Dxz28cZO5TrDcOoW0lY3a 3gSdwOkRpzGJUMo1ugk/Cf5AwVhrrMorEP54Q3rVIi4N+i2ue8pDJnsCXIr8td0ts4 LOtZBraxE/CHF9KXwYbwEXRYslXOCD0jz1T2IDbgAU8Z6iqdiqeyQ0OLndgxUMhK+/ N1EtrCDORYurg== Message-ID: Date: Mon, 9 Feb 2026 14:40:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Support logical replication of DDLs To: Vitaly Davydov , pgsql-hackers@lists.postgresql.org References: <080f9394-c127-4cef-865e-10f2f997125c@postgrespro.ru> From: Andreas Karlsson Content-Language: en-US In-Reply-To: <080f9394-c127-4cef-865e-10f2f997125c@postgrespro.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/2/26 5:04 PM, Vitaly Davydov wrote: > 1. Log into the WAL system catalog changes (tuples) suitable for logical > decoding (introduce a new wal_level = logical_ddl). I think, not all system > catalog changes are needed for decoding (not sure, we have to decode > pg_depend > changes). > > 2. Implement a decoder of system catalog changes, that can produce a > parse tree > using existing structures from parsenodes.h. > > 3. Based on the decoded parse tree, we can convert it into json or DDL SQL > statements in the output plugin. ParseTree to DDL SQL converter can be > built-in > into the core. Output plugin can decide which converter to use. DDL sql > can be > directly applied on the replica. > > 4. Another option is to create json/ddl-sql from system catalog changes > without > an intermediate representation, but, anyway, when we interpret system > catalog > changes we have to temporary save current data in some structures. > Parsenodes > is the already existing solution for it. With this approach how do you intend to handle DDL changes which alter data? To take a simple case we have the USING clause when altering a column. Maybe it is a fine limitation to just not support it but I am not convinced. Andreas