| From: | ZizhuanLiu X-MAN <44973863(at)qq(dot)com> |
|---|---|
| To: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, matheusssilv97 <matheusssilv97(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, masao(dot)fujii <masao(dot)fujii(at)gmail(dot)com>, david(dot)g(dot)johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, tgl <tgl(at)sss(dot)pgh(dot)pa(dot)us>, huseyin(dot)d3r <huseyin(dot)d3r(at)gmail(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, 我自己的邮箱 <44973863(at)qq(dot)com> |
| Subject: | Re: COMMENTS are not being copied in CREATE TABLE LIKE |
| Date: | 2026-07-20 13:24:19 |
| Message-ID: | tencent_FF05EDF384FEB7852516F57BE32C7C61DB06@qq.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
>Hi ZizhuanLiu
>
>Thanks for the detailed review!
>
>On 18.07.26 16:03, ZizhuanLiu X-MAN wrote:
>> 3. In cases where multiple source tables are referenced in one `LIKE` clause, I suggest skipping table
>> comment copying entirely. Concatenating multiple disparate table comments would result in bloated
>> and confusing text that fails to accurately describe the intended purpose of the combined new table.
>
>I slightly disagree. I don't have a strong opinion about it, but I find
>this a rather unnecessary limitation. I do understand the concern of a
>bloated comment, but doing so we sort of imply that *all* table comments
>are not fit for this feature, which is arguably not accurate. IMHO, if
>the user explicitly wants the comments to be copied, we should not judge
>if the they make sense or not -- of course, given that the documentation
>describes the concatenation.
>
>What do you think?
>
>Thanks for the comments. Much appreciated!
>
>Best, Jim
Hi Jim,everyone
Thanks a lot for your feedback.
I’ve been thinking about the scenario where multiple source tables are used, and here are my concerns:
1. Even putting aside the problem of bloated combined text, we need to consider whether
concatenating all source table comments delivers what developers, DBAs and business users
actually expect. Can the merged description accurately reflect the intended purpose of the
newly created table?
2. If we do implement comment concatenation, what merging rules should we adopt?
Should we cap the number of source tables whose comments get merged, or impose
a maximum character limit on the final combined text? Whichever restriction we pick
will likely require truncating parts of the original comments. After truncation, can the
resulting text still match what users intend to document?
3. In both cases outlined above, I believe the merged result will fail to satisfy users in
most real-world scenarios. Even if we build this merging logic, users will still end up
having to manually rewrite the table comment afterwards to fix it(Unless he does not
care about it). Given that extra manual cleanup work would be unavoidable, it may
be better to skip copying table-level comments entirely for multi-table cases.
4. It is indeed tricky to strike a balance between consistent feature behavior and intuitive,
reasonable usability, which is exactly why we’re having this discussion. Our ultimate goal is
to deliver a smooth experience for end users, so I think it makes sense to shape the design
around the needs of the vast majority of users in their common use cases.
Looking forward to hearing more thoughts from everyone.
regards,
--
ZizhuanLiu (X-MAN)
44973863(at)qq(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tomas Vondra | 2026-07-20 13:53:05 | Re: hashjoins vs. Bloom filters (yet again) |
| Previous Message | Chao Li | 2026-07-20 13:17:08 | Re: Fix RETURNING side effects for FOR PORTION OF leftover rows |