serial in postgres is being increased even though I added on conflict do nothing
The reason this feels weird to you is that you are thinking of the increment on the counter as part of the insert operation, and therefore the “DO NOTHING” ought to mean “don’t increment anything”. You’re picturing this: Check values to insert against constraint If duplicate detected, abort Increment sequence Insert data But in fact, … Read more