Postgres Insert without ANY VALUES FOR COLUMNS. ALL ARE DEFAULT

You can use either :

INSERT INTO test DEFAULT VALUES returning id;

And all the explanations you want are right here : https://www.postgresql.org/docs/current/sql-insert.html

The syntax of PostgreSQL is quite imposed.

DEFAULT VALUES : All columns will be filled with their default values. (An OVERRIDING clause is not permitted in this form.)


you need the values keyword, otherwise how would you tell how many rows you want to insert? However, you do not require the field names, so you can shorten your query a (very) little bit:

INSERT INTO pages VALUES(DEFAULT) RETURNING id;