Re: COMMENTS are not being copied in CREATE TABLE LIKE - Mailing list pgsql-hackers

From Jim Jones
Subject Re: COMMENTS are not being copied in CREATE TABLE LIKE
Date
Msg-id ceccea29-b7a9-4b79-9a06-6e1197d7f290@uni-muenster.de
Whole thread Raw
In response to Re: COMMENTS are not being copied in CREATE TABLE LIKE  (Jim Jones <jim.jones@uni-muenster.de>)
Responses Re: COMMENTS are not being copied in CREATE TABLE LIKE
List pgsql-hackers

On 13/02/2026 10:19, Jim Jones wrote:
> ...
> Example:
> 
> CREATE TABLE t1 (a int);
> COMMENT ON TABLE t1 IS 'comment from table 1';
> CREATE TABLE t2 (b int);
> COMMENT ON TABLE t2 IS 'comment from table 2';
> CREATE TABLE t3 (c int);
> COMMENT ON TABLE t3 IS 'comment from table 3';
> 
> CREATE TABLE tm (
>     LIKE t1 INCLUDING COMMENTS,
>     LIKE t3 INCLUDING COMMENTS,
>     LIKE t2 INCLUDING COMMENTS
> );
> 
> SELECT obj_description('tm'::regclass, 'pg_class') AS table_comment;
>     table_comment
> ----------------------
>  comment from table 1+
>  comment from table 3+
>  comment from table 2
> (1 row)
> 
> 
> Any thoughts on that?

Rebase

Best, Jim
Attachment

pgsql-hackers by date:

Previous
From: Henson Choi
Date:
Subject: Re: Row pattern recognition
Next
From: Henson Choi
Date:
Subject: Re: Row pattern recognition