DEFAULT sets a predefined value for a column any time an INSERT or UPDATE statement omits that column or explicitly uses the DEFAULT keyword. You declare the default in the table definition or as part of an ALTER TABLE statement. If a row is inserted without specifying the column, the database engine substitutes the default, ensuring non-null data, enforcing business rules, and simplifying application logic. Defaults can be constants, expressions, or database functions such as CURRENT_TIMESTAMP. When multiple columns have defaults, each behaves independently. A column can have only one default at a time; redefining it replaces the previous setting. The default is applied before constraints like CHECK or UNIQUE are validated. If a NOT NULL column has no default and receives no value, the statement fails. Beware that DEFAULT does not retroactively fill existing rows after alteration - only new or updated rows use it.
CREATE TABLE, ALTER TABLE, INSERT, NOT NULL, CHECK, GENERATED AS IDENTITY
SQL-92
If the INSERT specifies NULL explicitly, most databases accept the NULL value even when a default exists. Add a NOT NULL constraint to prevent this.
No. Altering a default only updates the table metadata. Existing rows are untouched, and no table rewrite occurs.
A column can have only one active default. Setting a new one replaces the previous definition.
Not technically, but highly recommended. Without a default, every INSERT must supply a value or the operation will fail due to the NOT NULL constraint.