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

From Andrey Borodin
Subject Re: CREATE TABLE LIKE INCLUDING TRIGGERS
Date
Msg-id 9F16DBBF-C805-433F-8D3C-3663D70190C1@yandex-team.ru
Whole thread
In response to CREATE TABLE LIKE INCLUDING TRIGGERS  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On Wed, Jul 8, 2026 at 1:05 PM jian he
<jian.universality@gmail.com> wrote:
> I also combined two patches (v10-0001, v10-0002) into one
> (v11-0001).

Hi Jian,

While revisiting v11, I realized that I had missed one design question
in my earlier review.

Since CREATE_TABLE_LIKE_ALL includes every option bit, adding
CREATE_TABLE_LIKE_TRIGGERS means that existing statements such as

  CREATE TABLE staging (LIKE production INCLUDING ALL);

will start copying user triggers after a major-version upgrade.  This
may cause a staging or replacement table to execute audit or other
application logic that it did not execute before.

Is this change in the meaning of INCLUDING ALL intended, or should
triggers require an explicit INCLUDING TRIGGERS?  There may already be
an established rule or an earlier conclusion about adding new LIKE
options to INCLUDING ALL that I have missed.

Thank you!


Best regards, Andrey Borodin.




pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: pg_rewind does not rewind diverging timelines
Next
From: Andrey Borodin
Date:
Subject: Re: GIN pageinspect support for entry tree and posting tree