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: doc: Clarify that COLUMN is optional in ALTER TABLE ... ADD/DROP
Date: Thu, 05 Mar 2026 03:59:27 +0000
Message-ID: <E1vxzrz-002SLW-2Y@gemulon.postgresql.org> (raw)

doc: Clarify that COLUMN is optional in ALTER TABLE ... ADD/DROP COLUMN.

In ALTER TABLE ... ADD/DROP COLUMN, the COLUMN keyword is optional. However,
part of the documentation could be read as if COLUMN were required, which may
mislead users about the command syntax.

This commit updates the ALTER TABLE documentation to clearly state that
COLUMN is optional for ADD and DROP.

Also this commit adds regression tests covering ALTER TABLE ... ADD/DROP
without the COLUMN keyword.

Backpatch to all supported versions.

Author: Chao Li <lic@highgo.com>
Reviewed-by: Robert Treat <rob@xzilla.net>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAEoWx2n6ShLMOnjOtf63TjjgGbgiTVT5OMsSOFmbjGb6Xue1Bw@mail.gmail.com
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9b0e5bd5320f95cfb35f0402c0f4bb7a1d3ecb0f

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml         |  4 ++--
src/test/regress/expected/alter_table.out | 10 ++++++++++
src/test/regress/sql/alter_table.sql      |  8 ++++++++
3 files changed, 20 insertions(+), 2 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1vxzrz-002SLW-2Y@gemulon.postgresql.org>
Permalink:  ../E1vxzrz-002SLW-2Y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vxzrz-002SLW-2Y@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: doc: Clarify that COLUMN is optional in ALTER TABLE ... ADD/DROP
  In-Reply-To: <E1vxzrz-002SLW-2Y@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