Documentation issue: Incorrect ALTER TABLE ... ALTER COLUMN syntax in PostgreSQL cheat sheet
Description
There is an issue in the PostgreSQL cheat sheet under the section:
"Set or remove a default value for a column:"
Page
https://neon.com/postgresql/cheat-sheet
Current documentation
ALTER TABLE table_name ALTER COLUMN [SET DEFAULT value | DROP DEFAULT]
Issue
The syntax is missing the required column_name.
In PostgreSQL, ALTER COLUMN must always be followed by a column name. The current documentation may mislead users into writing invalid SQL queries.
Correct syntax
ALTER TABLE table_name ALTER COLUMN column_name SET DEFAULT value;
ALTER TABLE table_name ALTER COLUMN column_name DROP DEFAULT;
Impact
This can lead to syntax errors for users, especially beginners learning PostgreSQL.
Suggestion
Update the syntax under "Set or remove a default value for a column:" to include column_name after ALTER COLUMN.
Additional context
Screenshot attached for reference.
Source: neondatabase/neon