"table_name.available_primary_key()," is 'auto incrementing'. Is available_primary_key able to re-use previously deleted primary keys and re-utilize them?

eg. assuming some random primary_keys such as 2, 9, 31, 56, 66, & 89, etc.. have been erased from a table filled with the max possible primary_keys, would it begin utilizing the next 'smallest' available_primary_key?

I want to assume the answer is yes, but the manual seems to imply otherwise?


1 Answer 1


No. available_primary_key() returns (the primary key of the last item) + 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.