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

From Hüseyin Demir
Subject Re: COMMENTS are not being copied in CREATE TABLE LIKE
Date
Msg-id 177174751973.626.7673368092428390674.pgcf@coridan.postgresql.org
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
Hi Jim,

I have a couple of concerns about the patch and I wanted to highlight the following cases.

1. Table comments tend to describe the purpose or context of a specific table (e.g. "staging table for pipeline X"),
unlikecolumn or constraint comments which describe the schema structure. Copying them by default may be wrong more
oftenthan it's right, since the new table almost certainly serves a different purpose than the source.
 
2. This changes the behavior of INCLUDING ALL, which many users rely on without thinking too carefully about what it
pullsin. Silently copying a source table's comment (which might say something like "template — do not use directly")
intoevery derived table could cause confusion in practice.
 

Neither of these is necessarily a blocker, but I think they're worth discussing before we commit to this as the default
behaviorunder INCLUDING COMMENTS.
 

Before reviewing the patch for code quality and repo standards, I think we need to decide whether this behavior change
isthe right approach at all. My preference would be to keep table comments managed separately, given the situations
above.

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: DOCS - Add an "Options" section for pg_controldata
Next
From: Mikael Kjellström
Date:
Subject: Re: ecpg test thread/alloc hangs on sidewinder running NetBSD 9.3