Postgres Serial primary key #193
-
I create 2 tables CREATE TABLE continentes ( CREATE TABLE cenarios ( when i try insert a data in continentes with a nonexistent foreing key, the right message is showed, but the primary key is incremented anyway. Example: cenarios: continentes try insert in continentes error on foreing key --> OK! try insert in continentes create a register with id = 3 (jumping id = 2) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is the default PostgreSQL behavior. It increases sequence value on every attempt of insert. And I can't change this behavior from DBeaver. |
Beta Was this translation helpful? Give feedback.
-
thanks Serge |
Beta Was this translation helpful? Give feedback.
This is the default PostgreSQL behavior. It increases sequence value on every attempt of insert. And I can't change this behavior from DBeaver.
You could try to work in transactional mode (just disable auto-commit mode in main toolbar) and rollback after error.