INSERT … DEFAULT VALUES
The DEFAULT VALUES
clause allows insertion of a record without providing any values at all, either directly or from a SELECT
statement.This is only possible if every NOT NULL
or CHECK
ed column in the table either has a valid default declared or gets such a value from a BEFORE INSERT
trigger.Furthermore, triggers providing required field values must not depend on the presence of input values.
Specifying DEFAULT VALUES
is equivalent to specifying a values list with expression DEFAULT
for all columns.
INSERT INTO journal
DEFAULT VALUES
RETURNING entry_id;