Re: CREATE TABLE LIKE INCLUDING TRIGGERS - Mailing list pgsql-hackers

From jian he
Subject Re: CREATE TABLE LIKE INCLUDING TRIGGERS
Date
Msg-id CACJufxGTxbpbaQjUxc69-Dovx6+KJd=81T5111uizUrdsEkDNQ@mail.gmail.com
Whole thread Raw
In response to Re: CREATE TABLE LIKE INCLUDING TRIGGERS  (Zsolt Parragi <zsolt.parragi@percona.com>)
List pgsql-hackers
On Thu, Jan 22, 2026 at 10:20 PM Zsolt Parragi
<zsolt.parragi@percona.com> wrote:
>
> After looking into this a bit more, I am more on the side of copying
> this setting properly.
>
> The already existing INCLUDING CONSTRAINTS copies the constraints,
> including their enabled/disabled status, correctly marking them
> disabled if a CHECK constraint is defined but not enforced. Wouldn't
> it be strange for INCLUDING TRIGGERS to work differently?
>

hi.
please check the attached.

v6-0001 is the same as v5-0001.
v6-0002 ensures that CREATE TABLE ... LIKE ... INCLUDING TRIGGERS
correctly copies the tgenabled status from the source table's triggers
to the new table



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

Attachment

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Convert NOT IN sublinks to anti-joins when safe
Next
From: "zengman"
Date:
Subject: Small fixes for incorrect error messages