pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make CREATE TABLE LIKE copy comments on NOT NULL constraints whe
Date: Thu, 26 Jun 2025 11:26:57 +0000
Message-ID: <E1uUkkr-003QPm-12@gemulon.postgresql.org> (raw)

Make CREATE TABLE LIKE copy comments on NOT NULL constraints when requested.

Commit 14e87ffa5c5 introduced support for adding comments to NOT NULL
constraints. However, CREATE TABLE LIKE INCLUDING COMMENTS did not copy
these comments to the new table. This was an oversight in that commit.

This commit corrects the behavior by ensuring CREATE TABLE LIKE to also copy
the comments on NOT NULL constraints when INCLUDING COMMENTS is specified.

Author: Jian He <jian.universality@gmail.com>
Co-authored-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/127debef-e558-4784-9e24-0d5eaf91e2d1@oss.nttdata.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/81ce602d48e8b9cbc3c3a7d5b9d9ddbea7789c02

Modified Files
--------------
src/backend/parser/parse_utilcmd.c              | 22 ++++++++++++++++++
src/test/regress/expected/create_table_like.out | 30 +++++++++++++++++++++----
src/test/regress/sql/create_table_like.sql      | 16 +++++++++++--
3 files changed, 62 insertions(+), 6 deletions(-)



Message-ID: <E1uUkkr-003QPm-12@gemulon.postgresql.org>
Permalink:  ../E1uUkkr-003QPm-12@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uUkkr-003QPm-12@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make CREATE TABLE LIKE copy comments on NOT NULL constraints whe
  In-Reply-To: <E1uUkkr-003QPm-12@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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