> Futhermore there is a simple test that you can do:
>
> Create a new object, delete it. Create a new object and check it's id.

Hm, that's not appropriate to prove that the re-use never happens.

I also checked the PostgreSQL documentation of its serial type for
which is probably used by Django for the AutoField. It seems to me
that the serial sequence generator is not well suited for re-using
deleted elements, but I'm not sure. It would be great if a Django or
general database expert could calrify this.

Best Regards,
Dirk


On Oct 10, 3:39 am, George Silva <georger.si...@gmail.com> wrote:
> I'm pretty sure that OID is not reused. It's database behavior to control
> this and my guess is that Django does not use old object ids.
>
> Futhermore there is a simple test that you can do:
>
> Create a new object, delete it. Create a new object and check it's id.
>
> George
>
>
>
>
>
> On Sat, Oct 9, 2010 at 9:51 PM, Dirk <dirk.juel...@googlemail.com> wrote:
> > If I use
>
> > id = models.AutoField(primary_key=True)
>
> > can I be sure that if an object is removed from the db by calling
> > its .delete() method, the respective id will not be used for any
> > subsequent .save() on a new object?
>
> > My application relies on the fact that an object's id is unique over
> > all objects, even deleted ones.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@google 
> > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> George R. C. Silva
>
> Desenvolvimento em GIShttp://blog.geoprocessamento.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to