Re: COMMENTS are not being copied in CREATE TABLE LIKE

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: Carlos Alves <carlos(at)alves(dot)inf(dot)br>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE
Date: 2026-03-25 09:21:56
Message-ID: fda18ba2-e39f-4e48-9b69-496d349de6bc@uni-muenster.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Carlos

On 24/03/2026 19:32, Carlos Alves wrote:
> Just one point I'd like to address is the documentation. Following the
> idea of the other "includings" options wouldn't it be interesting to
> present a more concise text? As a suggestion, it could be something like:
>
> "Comments on columns, not null and check constraints, indexes, extended
> statistics and the table itself from a source table will be copied. If
> the command references multiple source tables with including clauses,
> any existing table-level comments will be merged into a single entry,
> separated by newlines in the order they were specified."

In the second paragraph of the INCLUDING COMMENTS docs I wrote:

<para>
If multiple <literal>LIKE</literal> clauses specify
<literal>INCLUDING COMMENTS</literal> and the source tables have
table-level comments, these comments will be concatenated in the new
table, separated by newlines, in the order that the
<literal>LIKE</literal> clauses appear.
</para>

Which pretty much states the same? Please let me know if I am missing
your point here.

> I've attached some preliminary tests I performed.

Thanks for the thorough tests. Much appreciated!

Best, Jim

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2026-03-25 09:33:27 Re: [Patch] add new parameter to pg_replication_origin_session_setup
Previous Message Ashutosh Bapat 2026-03-25 09:12:18 Re: SQL Property Graph Queries (SQL/PGQ)