When you use liquibase’s instruction autoIncrement =”true”, for generation of primary key id, it generates serial column for PostgreSQL. For serial column PostgreSQL will create a sequence with a name like tablename_colname_seq. Default column values will be assigned from this sequence. But when you explicitly insert a value into serial column, it doesn’t affect sequence generator, and its next value will not change. So it can generate a duplicate value.