Chao Li <[email protected]> writes:
> On Feb 12, 2026, at 23:33, Jim Jones <[email protected]> wrote:
>> On 12/02/2026 16:08, Fujii Masao wrote:
>>> The documentation [1] states that INCLUDING COMMENTS copies comments for
>>> the copied columns, constraints, and indexes. It does not mention copying
>>> comments on the table itself. Therefore, not copying table comments with
>>> INCLUDING COMMENTS does not appear to be a bug. That is, the proposed patch
>>> seems more like an improvement than a bug fix.

>> Hmm, it seemed so obvious to me that I didn’t look more closely at the
>> documentation :) Although I struggle to see the rationale for not
>> copying a table’s comment in a CREATE TABLE LIKE ... INCLUDING COMMENTS
>> statement, I have to agree that the documentation is quite clear about
>> this limitation, and therefore it cannot really be considered a bug.
>> That said, it may well be worth considering for a future release.

> I feel the current behavior is proper. When you create a table using
> LIKE, you are cloning the structure, not the identity.

Yeah, I was about to make a similar comment.  We do not for example
clone the ownership or permissions of the source table.  Maybe there
is an argument for cloning the table-level comment but it's by no
means open-and-shut.  So I think the current behavior is intentional
not an oversight.  Might be good to go find the thread in which the
INCLUDING COMMENTS functionality was developed and see if there was
discussion.

(Speaking of which, I'm feeling very dubious about the nearby
proposal to invent LIKE INCLUDING POLICIES.  It's hard to credit
that it makes sense to clone RLS policies while not cloning
table ownership and permissions.  But I suppose I should raise
that point in that thread.)

                        regards, tom lane


Reply via email to