Gap in auto-increment IDs on Heroku Postgres <p>I've got a Ruby web app running on Heroku with a Postgres database. I've noticed the auto-incremented IDs have a gap in them around the time that the Postgres database was under "maintenance" by Heroku.</p> <p>The gap is a one-time thing, and then the IDs increment by 1 again. Like so:</p> <pre><code>ID | Created at | 2959 | 2016-02-14 21:07:05.149797 | 2960 | 2016-02-14 21:15:05.03284 | 2961 | 2016-02-14 22:59:19.634962 | 2994 | 2016-02-15 09:25:30.969881 | 2995 | 2016-02-15 09:44:38.49678 | 2996 | 2016-02-15 09:51:00.282624 | </code></pre> <p>The maintenance by Heroku happened in between the two records (<code>2961</code> and <code>2994</code>) being created, at <code>2016-02-15 04:00:00</code>.</p> <p>I've seen an explanation that a failed transaction will result in an ID being skipped over on the next successful commit, but I can't see anything in the application logs to indicate that any records were being created around the time.</p>