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/


Reply via email to