Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvW4t-005r4g-2t for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 07:46:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvW4s-00Ai8c-1q for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 07:46:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vvW4s-00Ai8U-0m for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 07:46:30 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvW4p-00000001M1K-0BeL for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 07:46:29 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-45f053b7b90so230060b6e.0 for ; Wed, 25 Feb 2026 23:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772091985; cv=none; d=google.com; s=arc-20240605; b=YWnMju/kwwJ2JqlciUQmPvHpxmApG4FK88Y0J5nieZTnNRjyGQNjHnCtXx9W9fSpBF YTqjIZjqGePtcgsqyFqWVY8xwppZANbiS8ClNWjMuo+Q5HLa1h8XPp5yprlzF7Vkrwqb af4j8K/mCUaP4dErp5DrFvyhY+jPQzrVhmOineFca+Lzbq7JH3/Ec63xmgh9nVvtb4la z7nZM/rwb7t27sAiv73TtW113Ga8kWLGtrfTTblJ7dO7NfJ/qKa8E0ssfl5VVJ/NOAFR UNKgzKSdTGy1i7GL/UvEFnHrgjR1Rw1I91kkrrepJ07dXldSMCjCuHfbcM9fxN+64kRd FH2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=2jgfMaVGwTtGo91uhxAn1mj6gFCQmRpXo9TPUgmSyEo=; fh=3e4X3yGbV9gj+YtS5jkYpF1UqxQuAFt7Ts4W9rXdDCk=; b=ght5DWs8Jr5bpyvqovbbXYVMr2drI8KkecLOf2xK8dqLjPUgkJ3F6NLNF29jZ+TcXT 5IhiInzyrWbExLdVsbMs/g1aQLtEjwSgK5Uo88c4+j09sdBuF02ZLaBwESkyKggDFyRt zEOrv1WUoDjbUhWgQZueCeuDnOaQJimTa4wSKZsj55dV5iBCkp+EhgfDP30nNjIewEgT vszgwsC1/Eoc0QaG5fn6vUkPjtCK+aOpwKgkXalnvcvIdsMqBsl8yHLQnjxRU4788OnL 88vPtzsZ4HKi2Ybz+YrDto3pd78jtekAobL5D0+Lv9mUUEt0Ord8ExM5vw+C7QbGoRUo VK7w==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772091985; x=1772696785; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2jgfMaVGwTtGo91uhxAn1mj6gFCQmRpXo9TPUgmSyEo=; b=Gh1C1VJkAkl7ElcjxU44Rr0AW6TTBxpw0fSXrBOWDVztJ8ekOr3cr58QjtsTfZItBH vlXlZBQN1uEhMOj2/VIjr/DNLFyh7ETtIx4rgDaoCg4uYavbx7ecqdL1wirtP1szMIHn RUmpykxcBgslAsPloo5qL+1ulZZmocsCY6FfmCw5HWbxoBJpl3S96S0rOcBRJprLXOq7 UMm7vPNpIpsabTBSXzyCX8ZB/HnUAtQFebAl4FYM/qGej49CMOrY1IA4xPHRgj87bJiu XcdH6ymQAjGkRCzaunlvGrk/1VjYCysjUtmAejf3KoMgcTqbUmPPk0DLqrZa0fHnxU92 2M2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772091985; x=1772696785; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2jgfMaVGwTtGo91uhxAn1mj6gFCQmRpXo9TPUgmSyEo=; b=E/ZHtxSpoJ7Cpmr3fbXFOPWVTXjDgl3v2DOq3n9B2Usx9wJohrGOT8C9ivzcLOpYyp eUH7dsSlyVQtKQxhIpYtF5QqXbhdGgCfShtwYw7qTHlH6Hmh4SLu8UTBpqA2el3+DDnl R5jz71pgBbUs8NMKdvkLmCuqDhfNwdeUhuiul2yg6sSOxfZ0OpTUYCDeF8D4Bw1jRYY3 juviml1z9FyWS2xUNqZ3ntdOOTIAhZ+H2/UM8drEcNiae+FiTpBvbZgWj4i7YZ0B67+z oGhtJaLKiq8lzFtZ1HXC+P/niDd07qO0QcwmPZ4lyoGWGLRu3OnTbMDBm0Iawt1dcav/ HzIw== X-Gm-Message-State: AOJu0Ywdjn2xPZ+KFBrVxfdJ+41NXV4+0+7wyxDAQSIIdSBM3W82pB+N XrpHL/vhxl+raAovYcZ0wHeg7nvCV5q1NlKMIHD1XwT3D+NKl0desYroIf8s4QMHRpIln5gWd52 KC/dmbXOudHmXqaUCaGJAKKFnq2Kqrww= X-Gm-Gg: ATEYQzxwKPIjL2m5B3cNgNsssrOTeoE2358wRCx5FejlS3NbZxVfqb0n1npFZMnBFuj UhboV+7yFRJMANmfB5V+4cECOhxM/acdZDsJ/lGr2fgNyQqvlcPclx9liGUo7JP61XjJEORSIH+ gGQieNbxlsjsHXr9SoQnGkk+fpzd0a+qGZHGbtpQ8TpRefjFlitiae3ZwHCAww1l88gpdIjLlC7 hZSDTOIoWIU3I7y2KB33DU+bN8LeQfAv4pIJiRCtBJXEMOgrdyR1+0bKB8E8XYIKJFHOGBaQBP7 fUI/+Im3D0boy35Lmf6RrkZDU0O2UMI0j4lzzgZOcz5OI1+TDpIIwmq9vP/EC7mC7AwtU2sYrR+ JuFIW+ZN5i7KfgViKDrIJjX1tqQ== X-Received: by 2002:a05:6820:611:b0:679:92c7:2c07 with SMTP id 006d021491bc7-679f3d043a6mr563140eaf.29.1772091985532; Wed, 25 Feb 2026 23:46:25 -0800 (PST) MIME-Version: 1.0 References: <5888209c-44b5-438a-abd3-7d07990b3a4c@uni-muenster.de> <177174751973.626.7673368092428390674.pgcf@coridan.postgresql.org> In-Reply-To: From: =?UTF-8?Q?H=C3=BCseyin_Demir?= Date: Thu, 26 Feb 2026 08:46:14 +0100 X-Gm-Features: AaiRm52wH9MGX9ekvzRYN88KzwUrcOavABwNGt3mj9qCPpj-SUa5x468VGk30wo Message-ID: Subject: Re: COMMENTS are not being copied in CREATE TABLE LIKE To: Jim Jones Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000004e9a18064bb55184" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004e9a18064bb55184 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jim, > Are you suggesting we should simply keep ignoring the table comments? Or > should we manage them differently? Yes, because changing the behavior will lead to misinterpretations while creating tables and tables derived from template ones will be presented differently with respect to comments they have. Such changes can cause unexpected different objects inside a database. For example, any existing script using INCLUDING COMMENTS or INCLUDING ALL will now copy the table comment where it didn't before. If we need this behavioral change my idea is to introduce a new sub-option or keep table comments excluded unless explicitly opted in. Because after changing the current behavior there is no way to implement old behavior. Regards. Jim Jones , 22 =C5=9Eub 2026 Paz, 13:34 tarihind= e =C5=9Funu yazd=C4=B1: > Hi H=C3=BCseyin > > On 22/02/2026 09:05, H=C3=BCseyin Demir wrote: > > 1. Table comments tend to describe the purpose or context of a specific > table (e.g. "staging table for pipeline X"), unlike column or constraint > comments which describe the schema structure. Copying them by default may > be wrong more often than it's right, since the new table almost certainly > serves a different purpose than the source. > > Good point. Comments may well lose their semantic value when placed in a > different context, but I'm not sure how it differs from column comments. > A column comment can also refer to a context (original table) that is no > longer applicable after cloning, specially when the CREATE TABLE LIKE > includes multiple tables. > > > > 2. This changes the behavior of INCLUDING ALL, which many users rely on > without thinking too carefully about what it pulls in. Silently copying a > source table's comment (which might say something like "template =E2=80= =94 do not > use directly") into every derived table could cause confusion in practice= . > > > It's also a valid concern - although I see it slightly differently. I we > take this line of reasoning too seriously, we might never be able to > expand CREATE TABLE LIKE, since the ALL keyword would be directly > affected (expanded) in the process. There are also other patches that > aim to expand CREATE TABLE LIKE, e.g. INCLUDING TRIGGERS[1] > > > > Before reviewing the patch for code quality and repo standards, I think > we need to decide whether this behavior change is the right approach at > all. My preference would be to keep table comments managed separately, > given the situations above. > > > Are you suggesting we should simply keep ignoring the table comments? Or > should we manage them differently? > > Thanks for the comments. Much appreciated! > > Best, Jim > > 1 - https://commitfest.postgresql.org/patch/6087/ > --0000000000004e9a18064bb55184 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Jim,=C2=A0

> Are you suggesting w= e should simply keep ignoring the table comments? Or
> should we ma= nage them differently?

Yes, because changing the behavio= r will lead to misinterpretations while creating tables and tables derived = from template ones will be presented differently with respect to comments t= hey have.

Such changes can cause unexpected differ= ent objects inside a database. For=C2=A0example, any existing script using = INCLUDING COMMENTS or INCLUDING ALL will now copy the table comment where i= t didn't before.=C2=A0

If we need this behavio= ral change my idea is to introduce a new sub-option or keep table comments = excluded unless explicitly opted in. Because=C2=A0after changing the curren= t behavior there is no way to implement old behavior.=C2=A0

<= /div>
Regards.


Jim Jones <= jim.jones@uni-muenster.de&= gt;, 22 =C5=9Eub 2026 Paz, 13:34 tarihinde =C5=9Funu yazd=C4=B1:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Hi H=C3=BCseyin

On 22/02/2026 09:05, H=C3=BCseyin Demir wrote:
> 1. Table comments tend to describe the purpose or context of a specifi= c table (e.g. "staging table for pipeline X"), unlike column or c= onstraint comments which describe the schema structure. Copying them by def= ault may be wrong more often than it's right, since the new table almos= t certainly serves a different purpose than the source.

Good point. Comments may well lose their semantic value when placed in a different context, but I'm not sure how it differs from column comments= .
A column comment can also refer to a context (original table) that is no longer applicable after cloning, specially when the CREATE TABLE LIKE
includes multiple tables.


> 2. This changes the behavior of INCLUDING ALL, which many users rely o= n without thinking too carefully about what it pulls in. Silently copying a= source table's comment (which might say something like "template = =E2=80=94 do not use directly") into every derived table could cause c= onfusion in practice.


It's also a valid concern - although I see it slightly differently. I w= e
take this line of reasoning too seriously, we might never be able to
expand CREATE TABLE LIKE, since the ALL keyword would be directly
affected (expanded) in the process. There are also other patches that
aim to expand CREATE TABLE LIKE, e.g. INCLUDING TRIGGERS[1]


> Before reviewing the patch for code quality and repo standards, I thin= k we need to decide whether this behavior change is the right approach at a= ll. My preference would be to keep table comments managed separately, given= the situations above.


Are you suggesting we should simply keep ignoring the table comments? Or should we manage them differently?

Thanks for the comments. Much appreciated!

Best, Jim

1 - https://commitfest.postgresql.org/patch/6087/
--0000000000004e9a18064bb55184--