Postgres identity column not recognized as having a default value. #5501
Closed
Description
PostgreSQL identity columns were introduced in version 10. They aim to replace the commonly used SERIAL
type, as it not compliant with the SQL standard - and is error prone, as you have to manage the sequence associated to. An identity column is basically a generated integer type with a sequence built-in it knows everything about (it won't pick nextval
if nextval
already exists).
The bug:
create table foo (id int primary key generated always as identity);
- Try to add an item in the foo
- Error: column
id
requires a value