public inbox for [email protected]
help / color / mirror / Atom feedFrom: Hüseyin Demir <[email protected]>
To: Jim Jones <[email protected]>
Cc: [email protected]
Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE
Date: Thu, 26 Feb 2026 08:46:14 +0100
Message-ID: <CAB5wL7Yp3o4yYdxQ6mBVV6B-s80BmueizkKmZHEC632wYPp8Bw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Hi Jim,
> Are you suggesting we should simply keep ignoring the table comments? Or
> should we manage them differently?
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.
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.
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.
Regards.
Jim Jones <[email protected]>, 22 Şub 2026 Paz, 13:34 tarihinde
şunu yazdı:
> Hi Hüseyin
>
> On 22/02/2026 09:05, Hüseyin Demir wrote:
> > 1. Table comments tend to describe the purpose or context of a specific
> table (e.g. "staging table for pipeline X"), unlike column or constraint
> comments which describe the schema structure. Copying them by default may
> be wrong more often than it's right, since the new table almost certainly
> serves a different purpose than the source.
>
> Good point. Comments may well lose their semantic value when placed in a
> different context, but I'm not sure how it differs from column comments.
> A column comment can also refer to a context (original table) that is no
> longer applicable after cloning, specially when the CREATE TABLE LIKE
> includes multiple tables.
>
>
> > 2. This changes the behavior of INCLUDING ALL, which many users rely on
> without thinking too carefully about what it pulls in. Silently copying a
> source table's comment (which might say something like "template — do not
> use directly") into every derived table could cause confusion in practice.
>
>
> It's also a valid concern - although I see it slightly differently. I we
> take this line of reasoning too seriously, we might never be able to
> expand CREATE TABLE LIKE, since the ALL keyword would be directly
> affected (expanded) in the process. There are also other patches that
> aim to expand CREATE TABLE LIKE, e.g. INCLUDING TRIGGERS[1]
>
>
> > Before reviewing the patch for code quality and repo standards, I think
> we need to decide whether this behavior change is the right approach at
> all. My preference would be to keep table comments managed separately,
> given the situations above.
>
>
> Are you suggesting we should simply keep ignoring the table comments? Or
> should we manage them differently?
>
> Thanks for the comments. Much appreciated!
>
> Best, Jim
>
> 1 - https://commitfest.postgresql.org/patch/6087/
>
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: <CAB5wL7Yp3o4yYdxQ6mBVV6B-s80BmueizkKmZHEC632wYPp8Bw@mail.gmail.com>
* 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