You need to test if the data is already in the db first. There is a handy method:
model_object, created = YourModel.objects.get_or_create(...) If you still get this errors, you might want to check if your sequence is in sync: select max(id) from yourapp_yourmodel; select * from yourapp_yourmodel_id_seq ; Thomas thomasbecht...@googlemail.com schrieb: > Hi all, > > Problem: I want to use Transaction to save data to a postgresql-db. > Error: IntegrityError: doppelter Schlüsselwert (double keyvalue) > verletzt (harm) Unique-Constraint > ... -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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 -~----------~----~----~----~------~----~------~--~---