doc: Clarify that COLUMN is optional in ALTER TABLE ... ADD/DROP COLUMN.
Fujii Masao <fujii@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/alter_table.sgml | modified | +2 −2 |
| src/test/regress/expected/alter_table.out | modified | +10 −0 |
| src/test/regress/sql/alter_table.sql | modified | +8 −0 |
Documentation touched
Discussion
- DOC: fixes multiple errors in alter table doc 20 messages · 2025-12-18 → 2026-03-09