
id is not incement by 1
id must be increment by 1
in version 9.5.0.5196 is behavior OK
problem is in great heidisql application
After inserting each row SELECT...WHERE id=nextval() is called. I believe it should be replaced with should be curval().
Problem occurs also in version 10.0.6005 :-(
Sorry for the long delay.
@arturm11 How should the SELECT look like instead? I just tested with .. WHERE "id"=curval('user_id_seq'::REGCLASS) like you suggested, but that returns an SQL error.
There is a typo here - should be currval
Sorry, my mistake, function name is currval. According to documentation:
nextval(regclass) | bigint | Advance sequence and return new value
currval(regclass) | bigint | Return value most recently obtained with nextval for specified sequence
https://www.postgresql.org/docs/current/functions-sequence.html
I am not sure where exactly bug is, anyway it looks that you call nextval multiple times while it should be called only once per each inserted row.
Maybe this could also help:
_insert into table (col2, col3) VALUES ('c1','c2') returning id;_
id is column where sequence is set as a default value...