Thought: should the primary key (id, AutoField) of the TestModel of the db check be a BigAutoField
maszaa opened this issue · comments
In our case I just checked the current value of the sequence and we have over 100 years to run out of integer serials so this is more like a thought at the moment. Should this be addressed? Maybe some use cases will run out of integers much quicker?
If the id
is going to be changed, the sequence in PostgreSQL must also be altered as versions after 9.6 have it stored as 32 bit number instead of 64 bit: https://www.postgresql.org/docs/10/release-10.html
Hi @maszaa,
Thanks for reaching out and addressing the issue. I just address the same issue in another comment.
In short, the table is always empty. Therefore, we will never run out of Integers. Of course, the sequence might reach the maximum integer, at which point you can simply reset the sequence to 0 and wait another 100 years ;)
Best,
Joe
Hi @maszaa,
Thanks for reaching out and addressing the issue. I just address the same issue in another comment.
In short, the table is always empty. Therefore, we will never run out of Integers. Of course, the sequence might reach the maximum integer, at which point you can simply reset the sequence to 0 and wait another 100 years ;)
Best,
Joe
I think health checks are usually automated. Once PostgreSQL sequence runs out it will throw an exception causing health check to fail. That would cause at least some downtime depending on the situation. My point of view was to provide resources for optimal automation and SLA.
You are right, the health check will fail. However, it will not cause downtime and in 100 years this might be a good reminder that you need to reset other sequences too.
You are welcome to contribute documentation for that feature. However, I don't want to maintain code that will not be executed once in my lifetime.