The conflict (INSERT) do not update the SEQUENCE?

There is a table in which to avoid duplicates created by the column count, which is updated every time when trying to add a duplicate, all this is implemented on the basis of a unique index on these columns.

To add/update, use the syntax:
INSERT INTO table (columns..)
VALUES (columns..)
ON CONFLICT (..columns) DO
 UPDATE SET count = table.count + 1

And every time UPDATE is called, the SEQUENCE value is changed to n+1
Is it possible for this process to influence?
July 2nd 19 at 17:06
1 answer
July 2nd 19 at 17:08
This behavior is standard for most DBMS. Before performing INSERT'a requests the next value for the SERIAL, and the DBMS increases the counter by one. But because the query execution time of several queries could require the same counter, the unused values will not be accepted back and are formed in the gaps.
Make your counter is possible, but at the cost of performance ( As a rule, the sense in this.

Find more questions by tags PostgreSQLSQL