]> git.ipfire.org Git - thirdparty/postgresql.git/commit
doc: Clarify that COLUMN is optional in ALTER TABLE ... ADD/DROP COLUMN.
authorFujii Masao <fujii@postgresql.org>
Thu, 5 Mar 2026 03:57:52 +0000 (12:57 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 5 Mar 2026 03:58:51 +0000 (12:58 +0900)
commit921f4a15c10f9791d6d57de7a4e714ef2d3a5fa9
treee55b57b17e078d0e02ce0af2fa90eb4193d0013d
parent1346794feb776603232e4cd330affe31ab3c4e1e
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
doc/src/sgml/ref/alter_table.sgml
src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql