Re: COMMENTS are not being copied in CREATE TABLE LIKE

From: Carlos Alves <carlos(at)alves(dot)inf(dot)br>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE
Date: 2026-03-26 17:59:44
Message-ID: 177454798496.946.17517925915684610719.pgcf@coridan.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: not tested
Documentation: tested, passed

Hi Jim!

The tests performed were as follows:

1. Basic: creating a table from another table containing comments and without comments;

2. Multiple tables: containing comments, without comments, changing the order of the tables;

3. Overriding inclusion and exclusion directives;

4. Comments with line breaks and special characters;

5. Creation of a table involving hundreds of original tables (stress test);

6. Comments in other structures: fields, indexes, constraints;

7. Output generated by pg_dump;

8. Documentation

No errors or failures were detected during the tests.

The only suggestion is to keep the parameter description a single paragraph, following the same style as the description of the other inclusion parameters. But the current description is coherent and okay.

After the tests, the patch is working as expected:
- Table-level comments are copied when the `including comments` parameter is used.
- When there is more than one source table, comments, if any, are kept in the order in which they appear in the command, separated by a new line.
- The performance of command execution was not affected.

I think only the code review is missing, but I don't have much experience to perform this step.

Best regards,
Carlos

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2026-03-26 18:12:04 Re: COMMENTS are not being copied in CREATE TABLE LIKE
Previous Message Andrey Borodin 2026-03-26 17:59:30 Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions