public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jim Jones <[email protected]>
To: Hüseyin Demir <[email protected]>
Cc: [email protected]
Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE
Date: Thu, 26 Feb 2026 11:07:34 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAB5wL7Yp3o4yYdxQ6mBVV6B-s80BmueizkKmZHEC632wYPp8Bw@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAB5wL7Yp3o4yYdxQ6mBVV6B-s80BmueizkKmZHEC632wYPp8Bw@mail.gmail.com>



On 26/02/2026 08:46, Hüseyin Demir wrote:
> Yes, because changing the behavior will lead to misinterpretations while
> creating tables and tables derived from template ones will be presented
> differently with respect to comments they have.

But isn't that the case to any feature that we add to CREATE TABLE LIKE?
For instance, if we add INCLUDING TRIGGERS, it will inevitably change
the behaviour of INCLUDING ALL.

> Such changes can cause unexpected different objects inside a database.
> For example, any existing script using INCLUDING COMMENTS or INCLUDING
> ALL will now copy the table comment where it didn't before. 

That's true, the newly created table would then get a comment it didn't
have before. I just fail to see how this would create an unexpected
different object.

Of course, if this script relies on the table not having a comment to
work, it could case some problems.

> If we need this behavioral change my idea is to introduce a new sub-
> option or keep table comments excluded unless explicitly opted in.
> Because after changing the current behavior there is no way to implement
> old behavior. 

The user can always use EXCLUDING COMMENTS for that

CREATE TABLE t2 (
  LIKE t1
    INCLUDING ALL
    EXCLUDING COMMENTS
);


Thanks, Hüseyin!

Best, Jim






view thread (18+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox