Re: CREATE TABLE LIKE INCLUDING TRIGGERS

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE TABLE LIKE INCLUDING TRIGGERS
Date: 2026-02-09 07:43:38
Message-ID: CACJufxEKK44FtxiShTZtPtCehwm47k5wB+RobuRCUJRa_b0owg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 6, 2026 at 10:49 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> This looks good to me, I only have two minor comments:
>
> 1. The test should drop main_table1 and some_t1
>
> 2. there's a missing word in a comment (do -> to do)
>
> + char *trigcomment; /* comment to apply to trigger, or NULL */
> + bool transformed; /* true means no need do parse analysis for *
> + * whenClause */

hi.
The attached have addressed these two points.

I still keep two separate patches, in case there are differing opinions about
whether to copy the old table’s trigger tgenabled to the new table.
Squashing them into a single patch is quite straightforward.

--
jian
https://www.enterprisedb.com/

Attachment Content-Type Size
v7-0002-CREATE-TABLE-LIKE-INCLUDING-TRIGGERS-copies-tgenabled.patch text/x-patch 7.8 KB
v7-0001-CREATE-TABLE-LIKE-INCLUDING-TRIGGERS.patch text/x-patch 42.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-02-09 07:43:40 Re: Convert NOT IN sublinks to anti-joins when safe
Previous Message Corey Huinker 2026-02-09 07:25:49 Re: Add expressions to pg_restore_extended_stats()