You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Reclassify DEFAULT as a column_constraint item in the CREATE TABLE syntax.
This is how it was documented originally, but several years ago somebodydecided that DEFAULT isn't a type of constraint. Well, the grammar thinksit is. The documentation was wrong in two ways: it alleged that DEFAULThad to appear before any other kind of constraint, and it alleged that youcan't prefix a DEFAULT clause with a "CONSTRAINT name" clause, when in factyou can. (The latter behavior probably isn't SQL-standard, but our grammarhas always allowed it.)This patch responds to Fujii Masao's observation that the ALTER TABLEdocumentation mistakenly implied that you couldn't include DEFAULT inALTER TABLE ADD COLUMN; though this isn't the way he proposed fixing it.
DROP [ COLUMN ] [ IF EXISTS ] <replaceable class="PARAMETER">column</replaceable> [ RESTRICT | CASCADE ]
37
37
ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> [ SET DATA ] TYPE <replaceable class="PARAMETER">type</replaceable> [ USING <replaceable class="PARAMETER">expression</replaceable> ]
38
38
ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> SET DEFAULT <replaceable class="PARAMETER">expression</replaceable>
REFERENCES <replaceable class="PARAMETER">reftable</replaceable> [ ( <replaceable class="PARAMETER">refcolumn</replaceable> ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ]
@@ -226,27 +227,6 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE [ IF NOT EXISTS ] <repl