public inbox for [email protected]  
help / color / mirror / Atom feed
Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs
4+ messages / 2 participants
[nested] [flat]

* Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs
@ 2026-02-17 14:36 Fujii Masao <[email protected]>
  2026-02-19 15:09 ` Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Matheus Alcantara <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Fujii Masao @ 2026-02-17 14:36 UTC (permalink / raw)
  To: [email protected]

Hi,

> Comments for the copied columns, constraints, and indexes will be copied.

The above current description of INCLUDING COMMENTS in the CREATE TABLE docs
appears inaccurate and incomplete. It says that comments on constraints are
copied, but in practice only comments on CHECK and NOT NULL constraints
are copied; comments on other constraints (such as primary keys) are not.
In addition, comments on extended statistics are copied, but this is not
documented.

The CREATE FOREIGN TABLE docs has a similar omission: comments on extended
statistics are also copied, but this is not mentioned.

Therefore I'd like to propose the attached patch to clarify the actual behavior
of INCLUDING COMMENTS. Thoughts?

Regards,


-- 
Fujii Masao


Attachments:

  [application/octet-stream] v1-0001-doc-Clarify-INCLUDING-COMMENTS-behavior-in-CREATE.patch (3.1K, ../../CAHGQGwHSOSGcaYDvHF8EYCUCfGPjbRwGFsJ23cx5KbJ1X6JouQ@mail.gmail.com/2-v1-0001-doc-Clarify-INCLUDING-COMMENTS-behavior-in-CREATE.patch)
  download | inline diff:
From d13955db8b1e03eccacd8600725d829bdf9446ac Mon Sep 17 00:00:00 2001
From: Fujii Masao <[email protected]>
Date: Tue, 17 Feb 2026 22:09:09 +0900
Subject: [PATCH v1] doc: Clarify INCLUDING COMMENTS behavior in CREATE TABLE
 LIKE.

The documentation for the INCLUDING COMMENTS option of the LIKE clause
in CREATE TABLE was inaccurate and incomplete. It stated that comments for
copied columns, constraints, and indexes are copied, but regarding comments
on constraints in reality only comments on CHECK and NOT NULL constraints
are copied; comments on other constraints (such as primary keys) are not.
In addition, comments on extended statistics are copied, but this was not
documented.

The CREATE FOREIGN TABLE documentation had a similar omission: comments
on extended statistics are also copied, but this was not mentioned.

This commit updates the documentation to clarify the actual behavior.
The CREATE TABLE reference now specifies that comments on copied columns,
CHECK constraints, NOT NULL constraints, indexes, and extended statistics are
copied. The CREATE FOREIGN TABLE reference now notes that comments on
extended statistics are copied as well.
---
 doc/src/sgml/ref/create_foreign_table.sgml | 6 +++---
 doc/src/sgml/ref/create_table.sgml         | 5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/ref/create_foreign_table.sgml b/doc/src/sgml/ref/create_foreign_table.sgml
index 08a8ceeae75..d3166e569ab 100644
--- a/doc/src/sgml/ref/create_foreign_table.sgml
+++ b/doc/src/sgml/ref/create_foreign_table.sgml
@@ -232,9 +232,9 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
         <term><literal>INCLUDING COMMENTS</literal></term>
         <listitem>
          <para>
-          Comments for the copied columns and constraints will be
-          copied.  The default behavior is to exclude comments, resulting in
-          the copied columns and constraints in the new table having no
+          Comments for the copied columns, constraints, and extended statistics
+          will be copied.  The default behavior is to exclude comments,
+          resulting in the corresponding objects in the new table having no
           comments.
          </para>
         </listitem>
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index 77c5a763d45..982532fe725 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -672,9 +672,10 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
         <term><literal>INCLUDING COMMENTS</literal></term>
         <listitem>
          <para>
-          Comments for the copied columns, constraints, and indexes will be
+          Comments for the copied columns, check constraints,
+          not-null constraints, indexes, and extended statistics will be
           copied.  The default behavior is to exclude comments, resulting in
-          the copied columns and constraints in the new table having no
+          the corresponding objects in the new table having no
           comments.
          </para>
         </listitem>
-- 
2.51.2



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs
  2026-02-17 14:36 Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Fujii Masao <[email protected]>
@ 2026-02-19 15:09 ` Matheus Alcantara <[email protected]>
  2026-02-19 15:51   ` Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Fujii Masao <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Matheus Alcantara @ 2026-02-19 15:09 UTC (permalink / raw)
  To: Fujii Masao <[email protected]>; [email protected]

On Tue Feb 17, 2026 at 11:36 AM -03, Fujii Masao wrote:
> Hi,
>
>> Comments for the copied columns, constraints, and indexes will be copied.
>
> The above current description of INCLUDING COMMENTS in the CREATE TABLE docs
> appears inaccurate and incomplete. It says that comments on constraints are
> copied, but in practice only comments on CHECK and NOT NULL constraints
> are copied; comments on other constraints (such as primary keys) are not.
> In addition, comments on extended statistics are copied, but this is not
> documented.
>
> The CREATE FOREIGN TABLE docs has a similar omission: comments on extended
> statistics are also copied, but this is not mentioned.
>
> Therefore I'd like to propose the attached patch to clarify the actual behavior
> of INCLUDING COMMENTS. Thoughts?
>

Hi, thanks for the patch.

The changes make sense to me, it sounds more clear. I've performed some
tests and the documentation seems correct about what comments are
actually copied.

--
Matheus Alcantara
EDB: https://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs
  2026-02-17 14:36 Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Fujii Masao <[email protected]>
  2026-02-19 15:09 ` Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Matheus Alcantara <[email protected]>
@ 2026-02-19 15:51   ` Fujii Masao <[email protected]>
  2026-02-26 00:09     ` Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Fujii Masao <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Fujii Masao @ 2026-02-19 15:51 UTC (permalink / raw)
  To: Matheus Alcantara <[email protected]>; +Cc: [email protected]

On Fri, Feb 20, 2026 at 12:10 AM Matheus Alcantara
<[email protected]> wrote:
>
> On Tue Feb 17, 2026 at 11:36 AM -03, Fujii Masao wrote:
> > Hi,
> >
> >> Comments for the copied columns, constraints, and indexes will be copied.
> >
> > The above current description of INCLUDING COMMENTS in the CREATE TABLE docs
> > appears inaccurate and incomplete. It says that comments on constraints are
> > copied, but in practice only comments on CHECK and NOT NULL constraints
> > are copied; comments on other constraints (such as primary keys) are not.
> > In addition, comments on extended statistics are copied, but this is not
> > documented.
> >
> > The CREATE FOREIGN TABLE docs has a similar omission: comments on extended
> > statistics are also copied, but this is not mentioned.
> >
> > Therefore I'd like to propose the attached patch to clarify the actual behavior
> > of INCLUDING COMMENTS. Thoughts?
> >
>
> Hi, thanks for the patch.
>
> The changes make sense to me, it sounds more clear. I've performed some
> tests and the documentation seems correct about what comments are
> actually copied.

Thanks for the review! Barring any objections, I will commit the patch.

Regards,

-- 
Fujii Masao





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs
  2026-02-17 14:36 Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Fujii Masao <[email protected]>
  2026-02-19 15:09 ` Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Matheus Alcantara <[email protected]>
  2026-02-19 15:51   ` Re: Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Fujii Masao <[email protected]>
@ 2026-02-26 00:09     ` Fujii Masao <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Fujii Masao @ 2026-02-26 00:09 UTC (permalink / raw)
  To: Matheus Alcantara <[email protected]>; +Cc: [email protected]

On Fri, Feb 20, 2026 at 12:51 AM Fujii Masao <[email protected]> wrote:
> Thanks for the review! Barring any objections, I will commit the patch.

I've pushed the patch. Thanks!

Regards,

-- 
Fujii Masao





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-02-26 00:09 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-17 14:36 Clarify INCLUDING COMMENTS behavior in CREATE TABLE and CREATE FOREIGN TABLE docs Fujii Masao <[email protected]>
2026-02-19 15:09 ` Matheus Alcantara <[email protected]>
2026-02-19 15:51   ` Fujii Masao <[email protected]>
2026-02-26 00:09     ` Fujii Masao <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox