Standard compliant IDENTITY columns are a way to auto-generated unique values for columns during an insert.

When defined as GENERATED BY DEFAULT the value is only generated if no explicit value has been supplied in the INSERT statement.

When defined as GENERATED ALWAYS the database will reject any explicitly provided value.
The generation can be bypassed by specifying OVERRIDING SYSTEM VALUE as part of the INSERT statement.

CREATE TABLE t1
(
  id INTEGER GENERATED ALWAYS AS IDENTITY
);

INSERT INTO T1 (id)  
VALUES (DEFAULT);

INSERT INTO T1 (id) OVERRIDING SYSTEM VALUE 
VALUES (42);

CREATE TABLE t2
(
  id INTEGER GENERATED BY DEFAULT AS IDENTITY
);
INSERT INTO t2 (id) 
VALUES (DEFAULT);

Back to the SQL Feature Comparison