Kasir Barati
04/21/2022, 11:18 AMusername
field unique
, and id
is serial
. OK. Now when I insert { username: 'Ali' }
, It will be inserted and in the response I get {id: 1, username: 'Ali'}
and I try to insert it again, database will yells and says that username is duplicate. So I try something else - { username: 'Mohammad' }
- and this time it will be inserted but I realized something weird and strange, The response will be {id: 3, username: 'Mohammad' }
.
Why? Why id
jumps one number (The number 2 is missed, Number 2 was the duplicate username
)?
Any though?
⢠IMO this is not a good thing.Kasir Barati
04/21/2022, 12:42 PMNurul
04/25/2022, 10:30 AM