constraint
DEFAULT
Supplies a value when a column is omitted. It is a value-generation clause, not an integrity constraint by itself; an explicit NULL does not invoke it. Target: PostgreSQL 17; focused syntax.
Formal Syntax & Structure
sql syntaxsql
status TEXT DEFAULT 'pending'Working Example
Example Snippetsql
CREATE TABLE t(id INT, status TEXT DEFAULT 'pending');INSERT INTO t(id) VALUES (1);INSERT INTO t VALUES (2,NULL);SELECT status FROM t ORDER BY id;