By toto


2017-03-03 11:58:53 8 Comments

We have a primary key of serial type that is incremented automatically based on Postgres sequence.

The problem is this field at midnight start having a big gaps between it values. example:

    Id
189040207
189040238
189040239
189040251
189040264
189040265

We don't have delete operation on this tables (we do only soft delete). We are using Postgres 9.3.

1 comments

@toto 2017-04-23 00:30:14

As discussed above the real problem is not the sequence it self but we found that we had a big number of aborted transactions!

And after fixing the sequence issue was fixed as well.

Related Questions

Sponsored Content

3 Answered Questions

[SOLVED] Adding 'serial' to existing column in Postgres

  • 2012-02-28 21:28:35
  • nicolaskruchten
  • 114168 View
  • 91 Score
  • 3 Answer
  • Tags:   postgresql

29 Answered Questions

7 Answered Questions

[SOLVED] postgres: upgrade a user to be a superuser?

  • 2012-05-25 15:43:18
  • flossfan
  • 320711 View
  • 648 Score
  • 7 Answer
  • Tags:   sql postgresql

1 Answered Questions

How can we execute Oracle sequence in Postgres?

2 Answered Questions

[SOLVED] Postgres incrementing null value in a column

1 Answered Questions

1 Answered Questions

[SOLVED] postgres 9.0.4 sequence skipping numbers

2 Answered Questions

[SOLVED] Migrate From MS SQL To Postgres With Hibernate

3 Answered Questions

[SOLVED] Fixing holes/gaps in numbers generated by Postgres sequence

Sponsored Content