Get the maximum possible ID value for a primary key?

34 views
Skip to first unread message

Stodge

unread,
Jan 9, 2019, 8:47:55 AM1/9/19
to Django users
Is there a way to get the maximum value that an ID can be for a model that uses AutoField for its primary key? For example, in PostgreSQL I could do:

SELECT maximum_value FROM information_schema.sequences WHERE sequence_name = 'my_sequence_id_seq';

 maximum_value
---------------
 
99999
(1 row)



I'm looking through the model meta data and the AutoField but I don't see anything.

Thanks

shiva kumar

unread,
Jan 9, 2019, 9:13:20 AM1/9/19
to django...@googlegroups.com
can you explain it indetail


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6c5d3bfc-b2ef-4ff1-b589-2f7b3ee07e0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages