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 1vbbPS-008fer-3B for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Jan 2026 09:25:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vbbPR-009p4Q-1k for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Jan 2026 09:25:26 +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 1vbbPR-009p4I-0I for pgsql-hackers@lists.postgresql.org; Fri, 02 Jan 2026 09:25:26 +0000 Received: from forwardcorp1d.mail.yandex.net ([178.154.239.200]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vbbPP-0043sN-1h for pgsql-hackers@postgresql.org; Fri, 02 Jan 2026 09:25:25 +0000 Received: from mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:65a0:0:640:e1de:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id E5734807BC; Fri, 02 Jan 2026 12:25:21 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6bf:8080:692::1:30]) by mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id LPhKo82ApmI0-ict6QfCu; Fri, 02 Jan 2026 12:25:21 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1767345921; bh=N75tLRvvY8cbAM/BSqQSapWvbWDlt6KhuiZDgvA4d4o=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=RrrKxOYEH8/VpOFKnsUe5UTqWIHZnLpBNFVOj+Zk4Ih4tc+nMmOctcrXDS5SIP67E 41drKbNCWv50fRsF1f4LpkRVdzWK3GNngZbeNgFij00BUufLPdhjD+JLkDLHrUA5zd 3lPfmtsK4QuQ2+KkkvltHwzHITvPhcktMxQoFZZs= Authentication-Results: mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: CREATE TABLE LIKE INCLUDING TRIGGERS From: Andrey Borodin In-Reply-To: Date: Fri, 2 Jan 2026 14:25:10 +0500 Cc: PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: References: To: jian he X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Jian! The feature makes sense from my POV. > On 31 Dec 2025, at 10:08, jian he wrote: >=20 > = I'm not an expert in the area, but still decided to review the patch a = bit. First two steps seems to add Oids along with RangeVars. It seems = suspicious to me. Parse Nodes seem to use "textual" identifiers without resolving them to = Oids. Oids are specific to session catalog snapshot, but parse nodes By adding Oid fields we will have to check both RangeVars and Oids all = over the code. Other INCLUDING options (indexes, constraints) don't modify their = statement nodes this way - they create fresh nodes with resolved = references. I'm not opposed, but I suggest you to get an opinion of an expert in = parse nodes about it, maybe in Discord if this thread does not attract = attention. It seems a fundamental stuff for two of your patchsets. + char *trigcomment; /* comment to apply to trigger, or NULL */ No other Create*Stmt has a comment field. Comments seem to be handled = through separate CommentStmt creation. Some nitpicking about tests: 1. INSTEAD OF triggers on views - The error is tested, but should also = test that statement-level VIEW triggers work 2. Triggers on partitioned tables - What happens when you LIKE a = partitioned table? Are partition triggers cloned? 3. Cross-schema trigger functions - The function name reconstruction = handles schemas, but is it tested? + funcname =3D = list_make2(makeString(schemaname),makeString(NameStr(procform->proname)));= Other NameStr() are pstrdup()'d, maybe let's pstrdup() this too? + /* Reconstruct trigger old transition table */ Second instance of this comment is wrong. + PG_KEYWORD("triggers", TRIGGERS, UNRESERVED_KEYWORD, BARE_LABEL) Won't this break some user SQLs? Thanks! Best regards, Andrey Borodin.=